Jump to content

Redirect traffic from whole site to specific folder


soycharliente

Recommended Posts

Is it possible to redirect all incoming traffic to a domain to one specific file on the domain?

 

I tried:

Redirect / /path/to/file.php

 

But then quickly realized that was an infinite loop. Can I do the same concept but have a condition to exclude that file.

 

Thanks.

You should be able to achieve this using a simple RewriteCond and RewriteRule...

 

Options +FollowSymlinks
RewriteEngine on

RewriteBase /
RewriteCond %{REQUEST_URI} !^path/to/file\.php$
RewriteRule ^.+$ path/to/file.php [R]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.