mod rewrite - How to delete .php extension from URL? -
How do I delete the .php extension from URL with mod_rewrite?
For example:
test.com/index.php - & gt; Test.com/index/ test.com/contact.php - & gt; Test.com/contact/
rewinding sign on rewrite ^ ([^ / ] +) /? $ $ 1.php
If the user is typed in This is going to work only for the first level of the directory; To wit. It will not match on http://example.com/index/
, then they http: // example Actually, this rule says "everything matches a base slot up to a slash, or if there is no slash, but it is not included in the slash. Then give to the user who connects with .php at the end. "
example.com/index/some/other/stuff
- There are no redirects.
Comments
Post a Comment