Last active
February 14, 2017 19:34
-
-
Save davidejones/e87c44fe6c93b72b79db to your computer and use it in GitHub Desktop.
htaccess splash cookie login
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteCond %{REQUEST_URI} !=/maintenance.html | |
RewriteCond %{REQUEST_URI} !=/login.cfm | |
RewriteCond %{REQUEST_URI} !^/mobile/ | |
RewriteCond %{REQUEST_FILENAME} !\.(gif|jpe?g|png|css|js|swf|xml|ttf|eot|woff|svg|pdf)$ | |
RewriteCond %{HTTP_COOKIE} !^.*splash.*$ [NC] | |
RewriteRule ^(.*)$ /maintenance.html [R=307,NC,L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Visiting any url will take you to the splash page maintenance.html (excluding login.cfm and images/css/fonts that might be used on splash, also allow mobile site) | |
To bypass visit login.cfm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteCond %{REQUEST_URI} !=/maintenance.html | |
RewriteCond %{REQUEST_URI} !=/login.cfm | |
RewriteCond %{REQUEST_FILENAME} !\.(gif|jpe?g|png|css|js|swf|xml|ttf|pdf)$ | |
RewriteCond %{HTTP_COOKIE} !^.*splash.*$ [I] | |
RewriteRule ^(.*)$ /maintenance.html [R=307,I,L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfcookie name="splash" value="1"> | |
<cflocation url="/index.cfm" addToken="no"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- | |
If there are issues with still being able to access the site add a manual redirect to a | |
.cfm file used throughout the website e.g base3 page.cfm | |
---> | |
<cfif !StructKeyExists(Cookie, 'splash')> | |
<cflocation url="/index.splash.htm"/> | |
<cfabort/> | |
</cfif> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment