I have a static website with files like index.php, blog.php, contact.php etc
How can I get my website addresses to work so that http://www.site.com/blog takes you to blog.php?
I think htaccess could do this for me, but am a php noob!
The only alternative I currently use is to create individual folders called ‘blog, contact etc’ which contains another index.php file inside it
thanks
Yes, you can use mod_rewrite to rewrite all urls. The following will rewrite all non-existing files and folders to requested filename .php:
Visiting
/blogand it’s not an existing directory will cause this rule to rewrite it as/blog.php.