0
我想提出一個尾部斜槓我的網址與.htaccess
添加的.htaccess結尾斜線和CSS了可怕的
我.htaccess
是
RewriteEngine On
RewriteBase/
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule^%1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*?)/?$ $1.php [NC,L]
當我嘗試使用www.example.com/about-us
它工作正常但是當網址是www.example.com/about-us/
我的css url不會加載網站會變得可怕。對不起,我的英語不好。
您應該將最近的2個RewriteConditions移動到第一個RewriteCond上方 –
更容易的是去除尾部的斜線。像[Laravel](https://github.com/laravel/laravel/blob/master/public/.htaccess#L9)一樣。 –