RewriteRule base directory

RewriteRule base directory

am 11.07.2007 18:48:36 von Salagir

Hello,

I'm trying to get a simple rewrite like
RewriteRule ^.*\.html$ display.php?page=$0

But this time, my php is in another folder, far away, even far from the
DocumentRoot of the site. And I can't get to it.
The php is still in the path defined in so I
thought it could work. Plus the RewriteRule is in the tag in
httpd.conf, not in an htaccess.

I tried many things, but each time the value of %{DocumentRoot} is
prepended. I tryed begining the path with ../../../ and such, it just
made another kind of error.
And I tryed modifing RewriteBase but no change either.

Do you have an idea ?


Example of what I try to do :

----- in httpd.conf -----


Options MultiViews Indexes FollowSymLinks
...
RewriteEngine on
RewriteRule ^.*\.html$ /home/salagir/sites/lib/display.php?page=$0


ServerName myfirstsite.com
DocumentRoot /home/salagir/sites/myfirstsite.com


ServerName mysecondsite.com
DocumentRoot /home/salagir/sites/mysecondsite.com


--- in /var/log/apache/error.log ---
[Wed Jul 11 18:43:22 2007] [error] [client ...] File does not exist:
/home/salagir/sites/myfirstsite.com/home/salagir/lib/display .php
^

When I add some "../" in the rewrite rule, directories are deleted from the
"^", not the beginning.

--
My Webcomic: www.geeksworld.org -+- All my websites: manaworld.free.fr

Re: RewriteRule base directory

am 14.08.2007 13:47:15 von Salagir

I'm really sorry for doing this but I'm asking my same problem as there
were no answers, and as I still didn't find a way a month after :(

I'm trying to get a simple rewrite like
RewriteRule ^.*\.html$ display.php?page=$0

But this time, my php is in another folder, far away, even far from the
DocumentRoot of the site. And I can't get to it.
The php is still in the path defined in so I
thought it could work. Plus the RewriteRule is in the tag in
httpd.conf, not in an htaccess.

I tried many things, but each time the value of %{DocumentRoot} is
prepended. I tryed begining the path with ../../../ and such, it just
made another kind of error.
And I tryed modifing RewriteBase but no change either.

Do you have an idea ?


Example of what I try to do :

----- in httpd.conf -----


Options MultiViews Indexes FollowSymLinks
...
RewriteEngine on
RewriteRule ^.*\.html$ /home/salagir/sites/lib/display.php?page=$0


ServerName myfirstsite.com
DocumentRoot /home/salagir/sites/myfirstsite.com


ServerName mysecondsite.com
DocumentRoot /home/salagir/sites/mysecondsite.com


--- in /var/log/apache/error.log ---
[Wed Jul 11 18:43:22 2007] [error] [client ...] File does not exist:
/home/salagir/sites/myfirstsite.com/home/salagir/lib/display .php
^

When I add some "../" in the rewrite rule, directories are deleted from the
"^", not from the beginning.

--
My Webcomic: www.geeksworld.org -+- All my websites: manaworld.free.fr