I want to redirect or rewrite sub directories to PHP files
Such as:
http://www.domain.org/contact
to this:
http://www.domain.org/index.php?sub=contact
I would REALLY like it is PHP could just read domain.org/contact as domain.org/index.php?sub=contact, but if it just redirects that way I'll be happy! I've searched for many solutions using .htaccess, but they are unclear or I can't get them to work specifically for what I am attempting to do
Thanks
Try this
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php?sub=$1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With