.HTACCESS Redirect Problem

Discussion in 'PHP' started by imchandan, May 11, 2008.

  1. #1
    Hi all, let me write down the code :-
    AddType application/x-httpd-php .php .html
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /blogs/
    DirectoryIndex /blogs/index.html
    ErrorDocument 404 /blogs/index.html
    RewriteRule ^blog/(.*).html$ /blogs/blog_disp.php?file=$1 [R,L]


    now the problem is, it redirect properly but it shows the URL in browser i.e. it shows /blogs/blog_disp.php?file=health-online-colleges
    .. please let me know how can i avoid this.. it should not show this URL, it should do the redirect silently.
     
    imchandan, May 11, 2008 IP
  2. AlastairDewar

    AlastairDewar Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I would change that last line to

    
    RewriteRule ^blog/(.*).html$ /blogs/blog_disp.php?file=$1 [L]
    
    Code (markup):
     
    AlastairDewar, May 12, 2008 IP
  3. ravi72194

    ravi72194 Banned

    Messages:
    270
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    yes
    use

    RewriteRule ^blog/(.*).html$ /blogs/blog_disp.php?file=$1 [L]
     
    ravi72194, May 12, 2008 IP
  4. imchandan

    imchandan Guest

    Messages:
    50
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #4
    thanks guys.. it worked... :)
     
    imchandan, May 12, 2008 IP