I want to redirect all traffic to a single .php gateway file, this file will do authentication and use ajax to pull the file that was requested.
So I need a .htaccess with flow like this:
if external request for any file
redirect (or rewrite) to /gateway.php
gateway.php would then need to be able to access the file.
This is the best ive come up with is:
RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_HOST} !^127\.0\.0\.1
RewriteCond %{REQUEST_URI} !/gateway\.php$
RewriteRule .* http://www.website.com/gateway.php?req=%{REQUEST_URI} [R=302,L]
This is working, but when the ajax on gateway.php tries to get the content from another page, it gets the content from gateway.php (because of the redirect). I need to add an exception somehow!
Any help would be greatly appreciated!