I have a website with a contact that used to work fine.
I've narrowed it down to this mod_rewrite rule that is causing the form not to work.
# 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
Rewr开发者_运维知识库iteRule ^([^.]+)\.php$ http://cacrochester.com/$1 [R=301,L]
How can I modify this so that it will not affect the contact form on the page http://cacrochester/Contact-Us.php, but it will still remove the extensions in the address bar?
Make that form point to the URL without .php.
Point to http://www.cacrochester.com/Contact-Us
instead of http://www.cacrochester.com/Contact-Us.php
.
精彩评论