我有以下规则为所有请求添加.html,以便用户导航到www.mysite.com/support
时,他们会看到我的www.mysite.com/support.html
页面:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html
如何更改此设置,以便对于特定网址,它会添加.php而不是.html:
感谢。
答案 0 :(得分:0)
我会将您的.htaccess
更改为:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^support /support.php [L]
RewriteRule ^contact /contact.php [L]
RewriteRule ^(.*)$ $1.html