Hi all,
Apologies to anyone who read the original version of this thread, I’ve had to change it due to getting a little further forward.
Basically i have a folder on my server that needs to be protected by a cookie.
[highlight=.htaccess]
<FilesMatch “\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)(\.gz)?$”>
Header set Expires “Thu, 15 Apr 2020 20:00:00 GMT”
Header unset ETag
FileETag None
</FilesMatch>
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
BrowserMatch MSIE ie
Header set X-UA-Compatible “IE=Edge,chrome=1”
</IfModule>
</IfModule>
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/folder(/.)
RewriteCond %{HTTP_COOKIE} !^gmvc=([0-9])$ [NC]
RewriteRule ^(.*)$ /login/1 [R=301,L]
RewriteCond $1 !^(index\.php|assets|folder)
RewriteRule ^(.*)$ /index.php/$1 [L]
When I go to /folder, the .htaccess redirects me to /login/1 as it should. After successfully logging in, I create a cookie called gmvc and redirect back to /folder
My problem is, that upon redirecting back to /folder, .htaccess then sends me back to /login/1 despite the cookie actually being created.
I'm really sorry for asking such a stupid question but I'm stuck and would really appreciate some help!
Cheers
Gavin