The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

mod_rewrite question (url changing)

Discussion in 'General Discussion' started by plague, Dec 21, 2007.

  1. plague

    plague Active Member

    Joined:
    Sep 22, 2006
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Brasil
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello.

    We have a server running apache 2.2 and one of our customers have some RewriteRules in his .htaccess. The rules works fine, but the url is changing while accessing the url. I'll try to explain.

    We have the following rule:

    RewriteRule ^grupoirs/area/(.*)$ http://www.domain.com.br/grupoirs.php?AreaID=$1 [QSA,L]

    When we access the adress "www.domain.com.br/grupoirs/area/3/servicos" we can access the page normally, but the url in the browser changes to "http://www.domain.com.br/grupoirs.php?AreaID=3/servicos". In Apache 1.3 this didn't happens. I have made tests with the Redirect tool in cPanel and the same occured.

    Is there a way to make the rewrite without changing the URL in the browser? Some code that I need to insert in the rule or a RewriteCond?
     
  2. darren.nolan

    darren.nolan Well-Known Member

    Joined:
    Oct 4, 2007
    Messages:
    259
    Likes Received:
    0
    Trophy Points:
    16
    RewriteRule ^grupoirs/area/(.*)$ /grupoirs.php?AreaID=$1 [QSA,L]

    Without the hostname before /grupoirs.php?AreaID=$1 [QSA,L]
     
  3. plague

    plague Active Member

    Joined:
    Sep 22, 2006
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Brasil
    cPanel Access Level:
    Root Administrator
    Twitter:
    I can't believe! Such a simple thing! And I lost 2 days "googling" for this.

    Sorry about my noob question =/



    Thanks a lot darren.nolan
     
Loading...

Share This Page