I am new to using regular expressions for rewriting URL's in htaccess
I need to redirect mysite.com/123 to mysite.com/, IF cookie named 'ref' is set.
my current htaccess is:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_COOKIE} ref=true [NC]
RewriteRule ^/([0-9]+)/$ http://www.mysite.com
</IfModule>
The goal is that when someone enters site with: mysite.com/111(some number) that they are redirected to the home page of the site after the cookie is set.
/123/
(note the trailing slash) -- are you testing with this? Does the redirect happen if you comment out theRewriteCond
?