Rewrite Rules are not taking effect

Discussion in 'Apache' started by kamal_anand, Oct 10, 2006.

  1. #1
    hi,
    i have modified the redirect rule in my httpd.conf as below,

    RewriteCond %{HTTP_HOST} aaa.domain.com
    RewriteCond %{QUERY_STRING} ^pagename=aaaa/bbb
    RewriteRule ^/servlet/server1$ http://domain/servlet/server2?pagename=aaaa/bbb [R,NE]

    but the effect is taking place only partially, thats the url is changed from sever1 to server2 but the page "aaaa/bbb" is the old one itself, it is not getting changed,

    thanks in advance
     
    kamal_anand, Oct 10, 2006 IP
  2. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #2
    You don't have to bother with httpd.conf. Just adding aaa.domain.com/.htaccess would do it, and it's much easior to do.

    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteRule ^servlet/server1$ servlet/server2?pagename=aaaa/bbb [R,NE]

    are you redirecting the URL?

    RewriteRule ^servlet/server1$ http://domain.com/servlet/server2?pagename=aaaa/bbb [R=301,L]

    Post an example of the URL you're geting redirect to if it goes to the wrong URL.
     
    Nintendo, Oct 11, 2006 IP
  3. maya786

    maya786 Peon

    Messages:
    85
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    you should simply use this

    seochat.com/seo-tools/url-rewriting/

    sorry url not allowed to me :confused:
     
    maya786, Oct 12, 2006 IP