问题描述:

I need the sloution for home page 301 redirection.

If I enter http://www.starmed.dk/index.php in the browse bar, then it will be redirected to http://www.starmed.dk without index.php

Any idea how to do this with an HTACCESS 301 redirect?

Thanks in advance.

网友答案:
//Rewrite to www
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^starmed.dk[nc]
RewriteRule ^(.*)$ http://www.starmed.dk/$1 [r=301,nc]

//301 Redirect Old File
Redirect 301 www.starmed.dk/index.php www.starmed.dk

Edit:

Perhaps your configuration is different. perhaps this:

RewriteRule ^www.starmed.dk/index.php$ www.starmed.dk/ [R=301]
网友答案:

Try the following :

DirectoryIndexRedirect Off
RewriteEngine on


RewriteRule ^index\.php$ / [L,R]
相关阅读:
Top