After looking a lot into stackoverflow i'm not able to figure it out. I have a website with the following structure
index.php
contact.php
about.html
forum(dir)
- index.php
- thread.php
What i want my htaccess to do
- Remove .php & .html extension, eg: when you visit contact page the url should be
www.domain.com/contact/
&www.domain.com/about/
- When the user visits the forum the url should be
www.domain.com/forum/thread/10004000/
instead ofwww.domain.com/forum/thread?id=10004000
I'm not sure how to figure it out. I was able to remove the extensions but failed in the /
"forward slash" part
This is my .htaccess part
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html [NC,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php [NC,L]