RewriteEngine On
RewriteRule ^/showlisting/(.*)$ showlisting.php/$1 [L]
RewriteRule ^/listings/(.*)$ listings.php/$1 [L]
RewriteCond %{HTTP_HOST} ^mydomain\.
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=301,L]
ErrorDocument 404 /notfound
In the above, this is what I want to achieve:
When I visit www.mydomain.com/showlisting/my-listing-data/with-more-slashes/and-some-text however it shows a 404 error, but with the .php added to showlisting, it works fine. Any ideas?
However note that the appending of the www. works fine - that's not the part I'm struggling with, although I included that part of the code anyway for full analysis.
Maybe
RewriteEngine On
RewriteRule ^showlisting/(.*)$ showlisting.php/$1 [L]
RewriteRule ^listings/(.*)$ listings.php/$1 [L]
RewriteCond %{HTTP_HOST} ^mydomain\.
RewriteRule ^$ http://www.mydomain.com/ [R=301,L]
ErrorDocument 404 /notfound