1

Is it possible to set a different alias based on whether a cookie is present? What I am trying to achieve is: use a different folder to display different content based on whether a cookie has been set in my browser, whilst keeping all the URL paths the same. Something like:

if(COOKIE=foo & value=val)
  alias /x /y
else
  alias /x /z

Any suggestions welcome

Thank you kindly! Jason

jbwt
  • 113
  • 3

1 Answers1

0

Try using something like this:

RewriteEngine on
RewriteCond %{HTTP_COOKIE} ***
RewriteRule /x(.*) /y$1 [L]
#else 
RewriteRule /x(.*) /z$1 [L]

Replace *** with the correct thing you want to match - see How do I make RewriteCond %{HTTP_COOKIE} match a cookie value exactly?

sa289
  • 1,308
  • 2
  • 17
  • 42