Clean URL Redirect Loop

后端 未结 4 1408
暖寄归人
暖寄归人 2020-12-15 00:46

I\'m trying to create clean URLs on my website. Now I succeeded in configuring apache so every request like mysite.com/page will work. But I also want that requests

4条回答
  •  生来不讨喜
    2020-12-15 01:12

    You could check the request line for what has originally been requested:

    RewriteCond %{THE_REQUEST} ^[A-Z]+\ (/[^\ ]*)\.php[?\ ]
    RewriteRule \.php$ %1 [R=301,L]
    

    Oh, and the first argument of the RewriteCond directive is not a regular expression but just a string. So the escaping the . is wrong.

提交回复
热议问题