1
除了位于子目录例如网页上的所有这些重定向的工作:重定向页面中的子文件夹新建文件夹
FR /东西
到
FR /其他-stuff
不起作用
RewriteEngine On
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase/
RewriteRule ^/?stuff$ http://example.org/more-stuff [R=301,L]
RewriteRule ^/?fr/stuff$ http://example.org/fr/other-stuff [R=301,L]
RewriteRule ^/?es/notice\.php$ http://example.org/es/ [R=301,L,QSD]
RewriteRule ^/?len.php$ http://example.org/es/ [R=301,L,QSD]
这是代码
# Use PHP5.4 as default
AddHandler application/x-httpd-php54 .php
RewriteEngine On
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase/
RewriteCond %{THE_REQUEST} \.htm
RewriteRule ^(.*)\.htm$ /$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.htm -f
RewriteRule ^([A-Za-z\-]+)$ $1.htm
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTP_HOST} !^\.localhost$ [NC]
RewriteRule ^(.+[^/])/$ http://%{HTTP_HOST}/$1 [R=301,L]
<FILES .htaccess>
order allow,deny
deny from all
</FILES>
在这个例子中东西其实是一个stuff.htm重定向到东西(在其他代码中),但我试过你的代码,它没有工作 – user3349491
啊问题是另一个冲突的htaccess文件 – user3349491