Mashi
05-15-2007, 10:06 AM
Hi,
I'm trying to make the redirect process for php5 files completely transparent (since I'd like to be able to use REQUEST_URI to get details of the request).
My .htaccess is as follows:
RewriteEngine On
# Pass any enquiries that aren't for static files over to server on port 9000 (php5)
RewriteCond %{SERVER_PORT} !9000
RewriteCond %{SCRIPT_FILENAME} !(css|js|jpg|gif|png)
RewriteRule ^(.*)$ http://%{HTTP_HOST}:9000/$1 [P]
# Direct everything on this port to index.php
RewriteCond %{SERVER_PORT} 9000
RewriteRule ^(.*)$ index.php [L]
The idea is that any requests that aren't for static files get passed "as they are" to port 9000, and then I can have my usual rewriterules for any request on port 9000.
However using this I get a 400 proxy error:
Your browser sent a request that this server could not understand.
The proxy server could not handle the request GET /index.php.
Reason: URI cannot be parsed: http://mashi.org:9000:9000/index.php
Making a request for the index.php file directly works as expected (http://www.mashi.org/index.php), though.
Any idea why it's adding the port on twice?
Thanks
edit: Just a note, the browser isn't being redirected:
Browser:
GET /fds HTTP/1.1
Host: www.mashi.org
Server:
HTTP/1.x 400 Proxy Error
I'm trying to make the redirect process for php5 files completely transparent (since I'd like to be able to use REQUEST_URI to get details of the request).
My .htaccess is as follows:
RewriteEngine On
# Pass any enquiries that aren't for static files over to server on port 9000 (php5)
RewriteCond %{SERVER_PORT} !9000
RewriteCond %{SCRIPT_FILENAME} !(css|js|jpg|gif|png)
RewriteRule ^(.*)$ http://%{HTTP_HOST}:9000/$1 [P]
# Direct everything on this port to index.php
RewriteCond %{SERVER_PORT} 9000
RewriteRule ^(.*)$ index.php [L]
The idea is that any requests that aren't for static files get passed "as they are" to port 9000, and then I can have my usual rewriterules for any request on port 9000.
However using this I get a 400 proxy error:
Your browser sent a request that this server could not understand.
The proxy server could not handle the request GET /index.php.
Reason: URI cannot be parsed: http://mashi.org:9000:9000/index.php
Making a request for the index.php file directly works as expected (http://www.mashi.org/index.php), though.
Any idea why it's adding the port on twice?
Thanks
edit: Just a note, the browser isn't being redirected:
Browser:
GET /fds HTTP/1.1
Host: www.mashi.org
Server:
HTTP/1.x 400 Proxy Error