我正在尝试设置 .htaccess 文件以重写 url,因此删除 .php 和 .html 等文件扩展名,目前只有 404 错误页面适用于 .htaccess
我试图更改的网址之一的示例是:http ://www.thinkbrainstormers.co.uk/clients.php
我正在尝试将其更改为http://www.thinkbrainstormers.co.uk/clients
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 2 days"
</IfModule>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html
ErrorDocument 404 /404.html
是 .htaccess 文件