Need help with redirection please

Discussion in 'Apache' started by sadiqsaad, Oct 9, 2008.

  1. #1
    sadiqsaad, Oct 9, 2008 IP
  2. classic

    classic Peon

    Messages:
    96
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try
    .htaccess
    
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php/$1
    
    #or
    #RewriteRule (.*) index.php
    
    Code (markup):
     
    classic, Oct 9, 2008 IP
  3. sadiqsaad

    sadiqsaad Peon

    Messages:
    405
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thx bro, but it didn't work.
     
    sadiqsaad, Oct 10, 2008 IP
  4. seismic2

    seismic2 Peon

    Messages:
    27
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Try this :
    RewriteEngine On
    RewriteBase /forum/
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /forum/index\.php\ HTTP/
    RewriteRule ^index\.php$ http://certcollection.org/forum/ [R=301,L] 
     
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /blog/index.php [L]
    Code (markup):
    Actually, the problem here is that any request for '/' is internally rewritten to 'index.php' by Apache mod_dir if DirectoryIndex contains index.php. So it's difficult to avoid a 500 error.

    This code looks at THE_REQUEST variable and determines whether it's an internal redirect or a request from a browser or bot. THE_REQUEST contains the first line of HTTP request header. It is something like “GET /index.php HTTP/1.1″. So, by verifying this variable, we can make sure that it isn't an internal redirect.
    If it's not an internal redirect, the code 301 redirects /index.php to "http://certcollection.org/forum/".
     
    seismic2, Oct 11, 2008 IP