Asked  7 Months ago    Answers:  5   Viewed   28 times

I have a website, and when i display any page the url will change to: or about.php or contact.php etc...

I have seen that you can create 'Clean urls' with .htaccess, but there the links were:$1.

is it possible for me to create clean urls?

i have tried this in a .htaccess document on my root folder:

    RewriteEngine On
    RewriteRule ^([a-zA-Z0-9]+)$ index.php

Some one who can help me please?? you need some more information? just ask and i wil answer it!!



You have the idea by using the rewrite rule, but you have missed out of the last bit.

RewriteRule ^([a-zA-Z0-9]+)$ index.php?id=$1

The $1 will take the first varable entered so you can have /index/example and the word example can be pulled as a _get['id']

You can create multipule in this way:

RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)$ index.php?id=$1&login=$2

and so on.


If you just want to make the URL look nicer follow this link and read up on all the different ways of using the rewrite rule.

You can change

To look more like this:

If thats what you are looking for then the rule you want to use is:

RewriteEngine On    # Turn on the rewriting engine
RewriteRule    ^pet-care/?$    pet_care_info_01_02_2008.php    [NC,L]    # Handle requests for "pet-care"

Quoted from

The "RewriteRule" line is where the magic happens. The line can be broken down into 5 parts:

RewriteRule - Tells Apache that this like refers to a single RewriteRule.

^/pet-care/?$ - The "pattern". The server will check the URL of every request to the site to see if this pattern matches. If it does, then Apache will swap the URL of the request for the "substitution" section that follows.

pet_care_info_01_02_2003.php - The "substitution". If the pattern above matches the request, Apache uses this URL instead of the requested URL.

[NC,L] - "Flags", that tell Apache how to apply the rule. In this case, we're using two flags. "NC", tells Apache that this rule should be case-insensitive, and "L" tells Apache not to process any more rules if this one is used.

# Handle requests for "pet-care" - Comment explaining what the rule does (optional but recommended)

Wednesday, March 31, 2021
answered 7 Months ago
# Turn On ReWrite Engine
RewriteEngine On

# Exclude url.php and index.php from redirecting
RewriteCond %{REQUEST_URI} !^/(index|url).php

# Redirect to url.php
RewriteRule . url.php [NC,L]
Wednesday, March 31, 2021
answered 7 Months ago

You can clean your project doing this

Build > Clean Project or Build > Rebuild Project

Also you can do the gradlew clean

enter image description here

As @Kellogs commented :

Manually delete the [project]/.gradle as hidden folder as that one is the main culprit for large cleaned projects sizes.

Tuesday, June 8, 2021
answered 5 Months ago

Please make a backup of your .htaccess file. Now remove all lines -- make it empty (there is too much noise there at the moment).

Add these lines to your empty .htaccess (should be in the root folder of your website):

RewriteEngine On
RewriteRule ^opslag/vis/(d+)$ /opslag/view.php?vis=$1 [NC,QSA,L] 

This should treat as

Please ensure that you have no more .htaccess files in opslag folder.

Saturday, July 31, 2021
answered 3 Months ago

You can use the vpath/VPATH in your Makefile

.SUFFIXES: .erl .beam .yrl

# use vpath to tell make where to search for %.erl files
vpath %.erl src eunit
# or use VPATH to tell make where to search for any prerequisite
# VPATH=src:eunit    

ERL_OBJ = $(patsubst src/%.erl,ebin/%.beam, $(wildcard src/*erl))
ERL_OBJ += $(patsubst eunit/%.erl,ebin/%.beam, $(wildcard eunit/*erl))

all: main

main: ${ERL_OBJ}

ebin/%.beam: %.erl
    erlc +debug_info -W -o ebin $<

    rm -fr ebin/*.beam
Thursday, October 21, 2021
answered 7 Days ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :