...

View Full Version : Apache rewrite



chiefbutz
09-10-2005, 10:26 PM
Can someone help me with this. Ok my current Address to the main part of my site is http://www.blahblah.com/main/index.php?pg=blah What can I do to make it be http://www.blahblah/index.php?pg=blah. What is the htaccess stuff I need to do?

mrruben5
09-11-2005, 02:54 AM
RewriteEngine On
RewriteEngine on
RewriteRule ^/main/$ / [QSA]correct me if i'm wrong

chiefbutz
09-11-2005, 01:51 PM
That doesn't do it

schleppel
09-11-2005, 06:48 PM
If you want to get rid of the /main/ for every request use this:


RewriteEngine On
RewriteRule ^main - [L]
RewriteRule ^(.*)?$ /main/$1 [QSA]


All files and folders must then be inside /main/ though (other than this .htaccess file).

hyperbole
09-11-2005, 09:58 PM
RewriteEngine On
RewriteRule (.*)/main(.*) $1$2 [QSA]

Try that.

chiefbutz
09-11-2005, 09:59 PM
Yep, that did it. Thank you!

EDIT: Only the first one did it, the second didn't



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum