Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-10-2005, 09:26 PM   PM User | #1
chiefbutz
New Coder

 
Join Date: Mar 2005
Location: Indiana (USA)
Posts: 50
Thanks: 4
Thanked 0 Times in 0 Posts
chiefbutz is an unknown quantity at this point
Apache rewrite

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?
chiefbutz is offline   Reply With Quote
Old 09-11-2005, 01:54 AM   PM User | #2
mrruben5
Regular Coder

 
Join Date: Nov 2004
Location: The Netherlands
Posts: 551
Thanks: 0
Thanked 0 Times in 0 Posts
mrruben5 is an unknown quantity at this point
Code:
RewriteEngine On
RewriteEngine on
RewriteRule ^/main/$ / [QSA]
correct me if i'm wrong
__________________
CATdude about IE6: "All your box-model are belong to us"
mrruben5 is offline   Reply With Quote
Old 09-11-2005, 12:51 PM   PM User | #3
chiefbutz
New Coder

 
Join Date: Mar 2005
Location: Indiana (USA)
Posts: 50
Thanks: 4
Thanked 0 Times in 0 Posts
chiefbutz is an unknown quantity at this point
That doesn't do it
chiefbutz is offline   Reply With Quote
Old 09-11-2005, 05:48 PM   PM User | #4
schleppel
Regular Coder

 
Join Date: Oct 2004
Posts: 330
Thanks: 0
Thanked 13 Times in 13 Posts
schleppel is an unknown quantity at this point
If you want to get rid of the /main/ for every request use this:
Code:
RewriteEngine On
RewriteRule ^main - [L]
RewriteRule ^(.*)?$ /main/$1 [QSA]
All files and folders must then be inside /main/ though (other than this .htaccess file).
schleppel is offline   Reply With Quote
Old 09-11-2005, 08:58 PM   PM User | #5
hyperbole
Regular Coder

 
Join Date: Sep 2005
Location: Madison, Indiana, USA
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
hyperbole is an unknown quantity at this point
Code:
RewriteEngine On
RewriteRule (.*)/main(.*) $1$2 [QSA]
Try that.
hyperbole is offline   Reply With Quote
Old 09-11-2005, 08:59 PM   PM User | #6
chiefbutz
New Coder

 
Join Date: Mar 2005
Location: Indiana (USA)
Posts: 50
Thanks: 4
Thanked 0 Times in 0 Posts
chiefbutz is an unknown quantity at this point
Yep, that did it. Thank you!

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

Last edited by chiefbutz; 09-11-2005 at 09:02 PM..
chiefbutz is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:59 PM.


Advertisement
Log in to turn off these ads.