I am trying to redirect users who are accessing an images folder using htaccess. I can do this, but wanted to know if there is a way to include the folder with / at the end. At the moment, I have to have two lines like this:
RewriteRule ^images$ http://www.website.com/ [R=301,L]
RewriteRule ^images/$ http://www.website.com/ [R=301,L]
You might benefit from reading the mod_rewrite tutorial linked in my signature as it contains explanations and sample code. It's helped may members and should help you, too.
That's the long answer. The short one is to delete the first RewriteRule and add a ? after the / in the second. What you've asked about is known as a metacharacter where ? denotes zero or one of the previous character, + denotes one or more and * denotes zero or more (and you DON'T want images/////////!!!).
This topic is now closed. New replies are no longer allowed.