Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

mod_rewrite question (url changing)

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

  1. plague

    plague Well-Known Member

    Joined:
    Sep 22, 2006
    Messages:
    48
    Likes Received:
    1
    Trophy Points:
    158
    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?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. darren.nolan

    darren.nolan Well-Known Member

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

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

    plague Well-Known Member

    Joined:
    Sep 22, 2006
    Messages:
    48
    Likes Received:
    1
    Trophy Points:
    158
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice