LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Use PHP URL processor script with Apache (http://www.linuxquestions.org/questions/linux-networking-3/use-php-url-processor-script-with-apache-206623/)

remi 07-18-2004 01:44 PM

Use PHP URL processor script with Apache
 
Hello,

Question here about Apache and PHP.

For some time, I've been maintaining my Web site, which has a lot of ServerAlias'es (can't set a VirtualHost for each since it's hosted at my provider) and RewriteRule's. It makes quite a lengthy .htaccess which is getting harder to maintain, especially when testing Web sites I'm developing.

So I would like a PHP URL processor. Something like all HTTP requests on Apache would go to a PHP script, which in turn will analyse the requested URL and give the correct URL (WITHOUT Redirect status code).

I tried the following simpler .htaccess:

Code:

RewriteEngine On

RewriteCond %{REQUEST_URI} !^/url.php [NC]
RewriteRule ^.*$ /url.php [L]

But, when the url.php script is done, obviously it sends a new request and Apache falls in the RewriteRule again, thus making a loop.

Any ideas on this?


All times are GMT -5. The time now is 03:40 PM.