Greetings apache gurus, I need help with redirection please. My forum URL is http://certcollection.org/forum/ or http://certcollection.org/forum/index.php What I want to do is when someone goes forum/index.php it should be redirected to forum/ Thx
Try .htaccess RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 #or #RewriteRule (.*) index.php Code (markup):
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/".