到目前爲止,我.htaccess
是這樣的:國防部重寫刪除斜線,但保持對目錄
RewriteEngine On
RewriteBase/
RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
RewriteRule^http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
<FilesMatch "\.(htm|php|js|css|htc|png|gif|jpe?g|ico|xml|csv|txt|swf|flv|eot|woff|svg|ttf|pdf|gz)$">
RewriteEngine Off
</FilesMatch>
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .*\.html$ index.php [L]
我想有網址尾隨重定向到一個沒有斜槓。但是應該保留目錄的斜線。
任何幫助將不勝感激!
更新: 經過一些更多的Google研究,我爲我組裝了一些工作解決方案。這兩個重寫刪除結尾斜槓和www重定向正在工作。
RewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^rudolfapotheke.de$ [NC]
RewriteRule ^(.*) http://www.%{HTTP_HOST}/$1 [L,R=301]
對不起,我的英語不好.... – Arwed 2013-03-10 20:47:39