Redirect All Traffic To One File With .htaccess

Redirect All Traffic To One File With .htaccess



At some point, you may find you want to do something like put your website into maintenance, or temporarily offline. This can be accomplished in a few easy steps:


Create a .php or .html file that you will use to redirect all traffic to. We will call this temp.html. Now add the following into your .htaccess file at the top:


RewriteEngine on
RewriteCond %{REQUEST_URI} !^/temp\.html$
RewriteRule (.*) http://mydomain.com/temp.html [R=307,L]


Now all visitors to your site no matter what part of the site they try to access will land on the temp.html that you created.

  • .htaccess, redirect
  • 0 Los usuarios encontraron esto útil
¿Le ha resultado útil esta respuesta?

Artículos relacionados

Welcome To kickassd Performance Webhosting

We are happy you have decided to use Kickassd as your Webhosting provider. This short article is...

Dedicated IP Information

Dedicated IPs in our shared hosting environment are shared account wide. For example let's say...

Install WordPress On cPanel

Here is a quick and simple Install WordPress On cPanel guide. Before you go any farther go...

Using Your R1Soft Backup Feature

We provide free daily incremental backups through R1Soft. This makes it extremely easy to restore...

Opcaching Information And Status Page

Kickassd Opcode CachingOn all of our servers Opcode caching is enabled globally to increase the...