Trouble with mod_rewrite and PHP Extensions - Help Making the Correct .htaccess File
- by nicorellius
I'm looking for a set of simple rules and redirects for my site. I've tried so many combinations that I'm starting to get confused.
I'm not sure how to set this up. Generally, without mod-rewrite, I would use relative paths to link to files:
<a href="link.php">Link</a>
if it's in the same directory.
Now I'd like to use this:
<a href="link">Link</a>
And so if you go to this page:
localhost/mysite/link
it will take you to the correct place, which would be:
localhost/mysite/link.php
But also, many directory levels deep I would like it to work as well:
localhost/mysite/group/link2
would go to:
localhost/mysite/group/link2.php
and:
localhost/mysite/group/section/link3
would go to:
localhost/mysite/group/section/link3.php
But then in all these cases, if someone were to type in this:
localhost/mysite/group/section/link3.php
in the URL bar, it would show this:
localhost/mysite/group/section/link3
Thanks