htaccess Redirect - First Segment to PHP File, Second Segment as Parameter
- by Steve
My htaccess redirect knowledge is somewhat weak, so I was hoping to get some help here.
I currently have the following redirect, which works well:
# remove trailing slash
RewriteRule ^(.*)/$ /$1 [L,R=301]
# redirect to clean URL
RewriteCond /%{REQUEST_FILENAME}.php -f
RewriteRule ^([a-zA-Z0-9_-\s]+)$ /$1.php
This takes a URL like…