ebsolutions — 2013-01-28T08:31:55-05:00 — #1
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]
dklynn — 2013-01-28T15:43:36-05:00 — #2
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/////////!!!).