httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bryan henry <bryan.he...@mail.utexas.edu>
Subject Re: [users@httpd] mod_rewrite on virtual host = bad request :: URL has document root after server name
Date Thu, 06 Mar 2003 19:46:23 GMT
that partially worked for me...
It initally was rewriting to
http://my.server.com/index.php?rw=vartopass

so, I removed the RewriteBase from .htaccess
and added the directory path to the rewrite rule like so:

RewriteEngine On
RewriteRule ^([^/]+)/$ /directory/rewritten/to/index.php?rw=$1 [L]

It all works now, what do you think? Good to keep it that way?
Seems so to me.

Thanks for your help and the tip on [L]
~ b r y a n



On Thu, 6 Mar 2003 20:33:51 +0100, Andrea Rossignoli <software@polin.it> 
wrote:

> Hi,
> I did some tests on my pc (windows),
> and I had your same problem.
> I saw that adding a slash before index.php it will be ok.
> So I'd use
> RewriteRule etcetc /index.phpetcetc
>
> Andrea~
>
> p.s.
> The L is good because it will stop the rewrite parser to fetch the
> followings rules when a rule matches.
>
> ----- Original Message -----
> From: "bryan henry" <bryan.henry@mail.utexas.edu>
> To: <users@httpd.apache.org>
> Sent: Thursday, March 06, 2003 20:05
> Subject: [users@httpd] mod_rewrite on virtual host = bad request :: URL 
> has
> document root after server name
>
>
>> Hello all, I am having a small problem I hope you can help me with. My 
>> URL
>> rewriting is not working exactly right, placing a document root in the
>> middle of the URL. This is on Windows 2000 running Apache 1.3, 
>> everythign
>> works fine on *nix environments.
>> thank you for the help, this will make my head feel better.
>>
>>
>>
>> I am requesting:
>> http://my.server.com/directory/rewritten/to/vartopass/
>>
>> Instead of rewriting to:
>> http://my.server.com/directory/rewritten/to/index.php?rw=vartopass
>>
>> I am getting:
>>
> http://my.server.com/c:/apache/htdocs/directory/rewritten/to/index.php?rw=va 
>
>
> rtopass
>> which of course is the source of my bad request.
>>
>>
>>
>> my.server.com is set up as a virtual host as follows:
>> <VirtualHost *>
>> ServerAdmin me@mail.com
>> DocumentRoot C:/Apache/htdocs
>> ServerName my.server.com
>> ErrorLog logs/com.server.my-error_log
>> CustomLog logs/com.server.my-access_log combined env=!worm
>> </VirtualHost>
>>
>>
>>
>> .htaccess is a follows:
>> RewriteEngine On
>> RewriteBase /directory/rewritten/to/
>>
>> RewriteRule ^([^/]+)/([^/]+)/([^/]+)/([^/]+)/$ index.php?rw=$1|$2|$3|$4
> [R]
>> RewriteRule ^([^/]+)/([^/]+)/([^/]+)/$ index.php?rw=$1|$2|$3 [R]
>> RewriteRule ^([^/]+)/([^/]+)/$ index.php?rw=$1|$2 [R]
>> RewriteRule ^([^/]+)/$ index.php?rw=$1 [R]
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> The official User-To-User support forum of the Apache HTTP Server 
>> Project.
>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> "   from the digest: users-digest-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server 
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>



-- 
 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message