sort of redirect help

galaxyAbstractor

Community Advocate
Community Support
Messages
5,508
Reaction score
35
Points
48
I need all links on my domain to redirect to my maintenance page at http://jagf.net/maintenance/maintenance.html (obviosly, that page shouldn't redirect to itself).

I guess this is done in .htaccess , how?
Edit:
ok now I tried this:

Code:
RewriteEngine On

# Check for maintenance file and redirect all requests
RewriteCond %{DOCUMENT_ROOT}/maintenance/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /maintenance/maintenance.html [L]

How do I make it ignore images and .css?
 
Last edited:

phpasks

New Member
Messages
145
Reaction score
0
Points
0
I need all links on my domain to redirect to my maintenance page at http://jagf.net/maintenance/maintenance.html (obviosly, that page shouldn't redirect to itself).

I guess this is done in .htaccess , how?
Edit:
ok now I tried this:

Code:
RewriteEngine On

# Check for maintenance file and redirect all requests
RewriteCond %{DOCUMENT_ROOT}/maintenance/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /maintenance/maintenance.html [L]
How do I make it ignore images and .css?

You can used this code for css rewrite cond.

PHP:
RewriteEngine on
RewriteCond %{REQUEST_URI}  .css$
RewriteRule ^(.+)$ css-ssc.php?css=%{REQUEST_URI}
 

galaxyAbstractor

Community Advocate
Community Support
Messages
5,508
Reaction score
35
Points
48
you mean like

Code:
RewriteEngine On

RewriteCond %{REQUEST_URI}  .css$
RewriteRule ^(.+)$ css-ssc.php?css=%{REQUEST_URI} 

# Check for maintenance file and redirect all requests
RewriteCond %{DOCUMENT_ROOT}/maintenance/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /maintenance/maintenance.html [L]
?

It doesen't work
Edit:
go to http://jagf.net/ for an example. Only the offsite content is loading
 
Last edited:

Mitch

New Member
Messages
908
Reaction score
0
Points
0
Cpanel has got redirect too. Use this link, (+ add your site name in front of it)
:2082/frontend/x3/mime/redirect.html ; so:
http://jagf.net:2082/frontend/x3/mime/redirect.html

Then check Wild Card Redirect. If this doesn't work, first save the .htaccess file in your root. And delete it. Now try again.
 
Last edited:

galaxyAbstractor

Community Advocate
Community Support
Messages
5,508
Reaction score
35
Points
48
Redirecting to http://jagf.net/maintenance will cause a redirection loop because 'http://.*/'

which is located at /home/viggeswe/

is above 'http://jagf.net/maintenance'

which is located at /home/viggeswe/public_html/maintenance

lol I did that before with my .htaccess. Google isn't my friend anymore. BTW, confusing error message lol
Edit:
got it working. close this
 
Last edited:
Top