mod_rewrite on windows

This is a discussion on mod_rewrite on windows within the Apache Web Server forums, part of the Web Server and Related Forums category; Hello, i moved .htaccess mod_rewrite configuration from linux box to windows and have a problem. Have just simple rule for ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-27-2006
opio
 
Posts: n/a
Default mod_rewrite on windows

Hello,

i moved .htaccess mod_rewrite configuration from linux box to windows
and have a problem. Have just simple rule for fancy urls.

RewriteEngine On
RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/html/index.php?param=$1 [QSA,L]

on linux box it works perfect, on windows the result is

'/html/C:/Public/_work/classic-cars/httpdocs/html/index.php'

It seems, mod_rewrite puts /html/ (relative path to virtualhost
document root) at the beginning. Don't know why.. if i move .htaccess
to root, mod_rewrite puts just '/'.

apache version is 2.0.58

Thanks for any advice..
Andrew

--
Ondrej Penicka
email: penicka@web2day.org
mobil: +420 602 11 55 88
icq: 127 721 075

  #2 (permalink)  
Old 06-28-2006
faxe
 
Posts: n/a
Default Re: mod_rewrite on windows

opio napisał(a):

> i moved .htaccess mod_rewrite configuration from linux box to windows
> and have a problem. Have just simple rule for fancy urls.
>
> RewriteEngine On
> RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/html/index.php?param=$1 [QSA,L]


How come you rewrite to PHYSICAL path when mod_rewrite used in .htaccess
expects virtual path (relative to DocumentRoot) there?

> on linux box it works perfect, on windows the result is
>
> '/html/C:/Public/_work/classic-cars/httpdocs/html/index.php'


That is correct - then the second argument of RewriteRule doesn't start
with a slash, it will be appended to the actual local URI. Windows
'C:/blahblah' from your %{DOCUMENT_ROOT} does not start with a '/'.

Just remove %{DOCUMENT_ROOT} from your RewriteRule or check
http://httpd.apache.org/docs/2.0/mod...ml#rewritebase for
internal redirects relative to physical paths.

--
best regards
Paweł Zdziarski
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:39 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0