Q:

HTACCESS Redirect if title empty

I have url like this: http://mydomain.tld/product/dynamic-title.html
the problem is when i try access with no title like this:
http://mydomain.tld/product/.html
it still shown page, i want to redirect to homepage or 404.
RewriteEngine On
RewriteRule ^/*product\/\.html$ . [L]

the regex above not working..
Thank you

A:

You can have this rule for that condition:
RewriteRule ^product/\.html$ / [L,R,NC]

OR a more generic rule to catch all /.html URIs:
RewriteRule /\.html$ / [L,R,NC]

