Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: Apache rewrite

  1. #1
    New Coder
    Join Date
    Mar 2005
    Location
    Indiana (USA)
    Posts
    50
    Thanks
    4
    Thanked 0 Times in 0 Posts

    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?

  • #2
    Regular Coder
    Join Date
    Nov 2004
    Location
    The Netherlands
    Posts
    551
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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"

  • #3
    New Coder
    Join Date
    Mar 2005
    Location
    Indiana (USA)
    Posts
    50
    Thanks
    4
    Thanked 0 Times in 0 Posts
    That doesn't do it

  • #4
    Regular Coder
    Join Date
    Oct 2004
    Posts
    363
    Thanks
    0
    Thanked 18 Times in 18 Posts
    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).

  • #5
    Regular Coder
    Join Date
    Sep 2005
    Location
    Madison, Indiana, USA
    Posts
    166
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    RewriteEngine On
    RewriteRule (.*)/main(.*) $1$2 [QSA]
    Try that.

  • #6
    New Coder
    Join Date
    Mar 2005
    Location
    Indiana (USA)
    Posts
    50
    Thanks
    4
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •