Hi guys,
Can someone please check my htaccess file if it optimized. It works really well -- i just want to make sure it's not overcomplicated and slowing my site down:
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
# REDIRECT TO PHP SITEMAP
RewriteRule ^(.*)sitemap.xml$ /sitemap.php [L]
# REDIRECT TO PHP RSS
RewriteRule ^(.*)rss.xml$ /rss.php [L]
# ADD WWW TO START
RewriteCond %{HTTP_HOST} !^www\.[a-z-]+\.[a-z]{2,6} [NC]
RewriteRule ^.*$ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# ADD FORWARD SLASH AT END/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^.*$ %{REQUEST_URI}/ [R=301,L]
I want to add one more line -- but i do not know how to do it.
If someone goes to my site like this:
site.com/dog/ <-- i want it to show the page /animals/dog.php
BUT if someone goes to my site like this:
site.com/ben/dog/ <-- i want it to go to the same page (animals/dog.php), but pass "ben" as a variable.
If anyone could help with either of these problems thanks 🙂