domain.com vs. domain.com/index.php/html redirect

Sickness

New Member
Hi all,

I am trying to set a 301 redirect from www.domain.com/index.html to www.domain.com. (the redirect from the non www version to the www version is already done through htaccess using this code:
Code: Redirect to www (htaccess redirect)Create a .htaccess file with the below code, it will ensure that all requests coming in to domain.com will get redirected to www.domain.com The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed) Options +FollowSymlinksRewriteEngine onrewritecond %{http_host} ^domain.com [nc]rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc] Please REPLACE domain.com and www.newdomain.com with your actual domain name. Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.I have done some research and have found this code to rewrite the index.html to the root directory:
Code: RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/RewriteRule ^index\.html$ http://%{HTTP_HOST}/ [R=301,L]Before I break the whole site , could somebody give me some insight? Is that going to do the trick?

The website is run on a Linux server.

Thanks! That should do the trick without doing it on all subfolders. Just shout if you have any issues with that. Quote: Originally Posted by BradCallen That should do the trick without doing it on all subfolders. Just shout if you have any issues with that. alright, I'll give it a try then Must have worked! It's been a few days and you have not updated

Either that or it broke everything and now you are frantically posting on the Apache forum.
 
Back
Top