Using .htaccess and mod_rewrite
Question by InVert
I’m having some mod_rewrite problems with my .htaccess..
RewriteBase /folder
RewriteEngine on
RewriteRule ^(.*)$ basic.php?url=$1 [L]
Above is what I’m current using .. However I have no idea what I’m doing to be honest as I’m just cycling through the internet trying to figure this out.
Basically, for my website, if you type in
“www.domain.com/folder/xxx/”
I want it to basically be “www.domain.com/folder/basic.php?url=xxx”
For some reason, all that does is cause a 404 error :/
So can someone please politely point me in the right direction?
Answer by Starx
Ok, I will explain using your htaccess.
RewriteEngine on
Turn on the Rewrite Module to enable URL rewriting
RewriteBase /folder
Rewrite the Base Directory to directory name folder
RewriteRule ^folder/(.*)$ basic.php?url=$1 [L]
Remap every request make using the folder/*****
to basic.php?url=********
Note: RewriteEngine On
Should be the first statement on your case