0

我的网站上有这段代码,我需要将http://softsolutions.fr重定向到http://www.softsolutions.fr,但它没有重定向:

<IfModule mod_rewrite.c>    
  Options +FollowSymlinks
  Options +Indexes
  RewriteEngine On

    RewriteCond %{HTTP_HOST} ^softsolutions\.fr
    RewriteRule ^(.*)$ http://www.softsolutions.fr/index.html [R=301,L]     

  RewriteRule    ^$    /index.html    [L]

    # Rewrites "sub.domain.foo/anything" to "sub.domain.foo/anything.php"
    RewriteCond %{REQUEST_FILENAME} !^(.+).php$
    RewriteCond %{REQUEST_FILENAME} !^(.+).pdf$
    RewriteCond %{REQUEST_FILENAME} !^(.+).(html|htm)$
    RewriteRule    ^([a-zA-Z0-9\-\_/]*)$    /$1.php    [L]  

</IfModule>
4

1 回答 1

0

替换这些行:

RewriteEngine On

RewriteCond %{HTTP_HOST} ^softsolutions\.fr
RewriteRule ^(.*)$ http://www.softsolutions.fr/index.html [R=301,L] 

和:

RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} ^softsolutions\.fr [NC]
RewriteRule (.*) http://www.%{HTTP_HOST}%{REQUEST_URI}
于 2012-10-05T14:47:35.650 回答