我有一个网站,其联系人曾经工作正常。
我已将其缩小到导致表单不起作用的mod_rewrite规则。
# If client requested does not exist as a directory or a file
# then add .php to the actual filename
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php [L]
# Gets rid of the file extensions in the address bar
# If client request header contains php file extension
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+)\.php\ HTTP
# externally redirect to extensionless URI
RewriteRule ^([^.]+)\.php$ http://cacrochester.com/$1 [R=301,L]
如何对其进行修改,使其不会影响页面http://cacrochester/Contact-Us.php上的联系表单,但仍会删除地址栏中的扩展程序?
答案 0 :(得分:0)
使该表单指向不带 .php 的网址。
指向http://www.cacrochester.com/Contact-Us
而不是http://www.cacrochester.com/Contact-Us.php
。