This is a discussion on "Your browser sent a request that this server could not understand." within the Apache Web Server forums, part of the Web Server and Related Forums category; Hi, In order to map the websites I develop locally easily I set up Apache mod rewrite tomap a url ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi,
In order to map the websites I develop locally easily I set up Apache mod rewrite tomap a url to a directory. Thsi way I do not have to make a Virtual directory for every project but the URL is being rewritten to map a directory on the local system. Here's the setup: I set up an A record in the DNS of my domain to point back to the local machine wjenI use a special prefix in the URL: *.local 127.0.0.1 (saying "every subdomain ending with .local is to be redirected to localhost) I set up Apache's httpd.config Mod Rewrite like this: LoadModule rewrite_module modules/mod_rewrite.so (remove the comment - # - sign) RewriteEngine on RewriteCond %{HTTP_HOST} (.*)\.local.mydomain.com RewriteRule (/.*) D:/www/wwwroot/%1/$1 (saying: every request ending on local.mydomain.com has to be rerouted to the directory D:/www/wwwroot/<whatever preceded .local.mydomain.com>/<whatever followed.local.mydomain.com) This worked fine: if I had a directory "d:/www/shipyards/q.cfm all I had to enter in my address bar was "http:// shipyards.local.mydomain.com/ q.cfm and q.cfm was served. Until yesterday, the same url (http://shipyards.local.mydomain.com/ q.cfm) only gives me this response --------------------------- Bad Request Your browser sent a request that this server could not understand. --------------------------- Apache_error log gives this: [Sat Jun 14 13:29:10 2008] [error] [client 127.0.0.1] Invalid URI in request GET / HTTP/1.1 [Sat Jun 14 13:29:20 2008] [error] [client 127.0.0.1] Invalid URI in request GET /q.cfm HTTP/1.1 Apache access log gives this: --------------------------- 127.0.0.1 - - [14/Jun/2008:13:29:10 +0200] "GET / HTTP/1.1" 400 226 127.0.0.1 - - [14/Jun/2008:13:29:20 +0200] "GET /q.cfm HTTP/1.1" 400 226 --------------------------- I have no idea why the web browser doesn't recognize these requests anymore and there is nothing that comes to mind I might have changed that caused this behaviour. I tried setting up Virtual Hosts to circumevent the problemn but there Apache won't start for other errors in the config file. And actually I want the situations with Mod rewrite back as before. Can anyone here help me out? Thanks! Windows XP SP2 WAMP Server: Apache 2.2.8 FireFox 2.0.0.14 / IE 7.0.5730.13 |