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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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 |