开发者

Mod_rewrite is causing contact form to not work

开发者 https://www.devze.com 2023-01-30 08:54 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号