RewriteEngine on
RewriteCond %{HTTP_COOKIE} ^.*user_id=(\d+).*$ [NC]
RewriteRule .* http://localhost/mysite/cache/$1 [R=301,L]
RewriteRule .* http://localhost/mysite/cache/guest [R=301,L]]
RewriteEngine on
RewriteRule ^.+$ - [L]
RewriteCond %{HTTP_COOKIE} ^.*user_id=(\d+).*$ [NC]
RewriteRule .* http://localhost/mysite/$1 [R=301,L]
RewriteRule .* http://localhost/mysite/guest [R=301,L]
How to do htaccess redirect based on cookie value
Dev2Tricks
5 of 5
RewriteEngine on RewriteCond %{HTTP_COOKIE} ^.*user_id=(\d+).*$ [NC] RewriteRule .* http://localhost/mysite/cache/$1 [R=301,L] Rewrite...
Share this