SearchSearch   

RewriteRule base directory

 
   Webmaster Forums (Home) -> Apache RSS
Next:  Directory access  
Author Message
Salagir

External


Since: Sep 15, 2003
Posts: 31



(Msg. 1) Posted: Wed Jul 11, 2007 4:48 pm
Post subject: RewriteRule base directory
Archived from groups: alt>apache>configuration (more info?)

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 <Directory (thepath)> so I
thought it could work. Plus the RewriteRule is in the <Directory> 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 -----

<Directory /home/salagir/sites>
Options MultiViews Indexes FollowSymLinks
...
RewriteEngine on
RewriteRule ^.*\.html$ /home/salagir/sites/lib/display.php?page=$0
</Directory>
<VirtualHost *>
ServerName myfirstsite.com
DocumentRoot /home/salagir/sites/myfirstsite.com
</VirtualHost>
<VirtualHost *>
ServerName mysecondsite.com
DocumentRoot /home/salagir/sites/mysecondsite.com
</VirtualHost>

--- 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
Back to top
Salagir

External


Since: Sep 15, 2003
Posts: 31



(Msg. 2) Posted: Tue Aug 14, 2007 11:47 am
Post subject: Re: RewriteRule base directory
Archived from groups: per prev. post (more info?)

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 Sad

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 <Directory (thepath)> so I
thought it could work. Plus the RewriteRule is in the <Directory> 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 -----

<Directory /home/salagir/sites>
Options MultiViews Indexes FollowSymLinks
...
RewriteEngine on
RewriteRule ^.*\.html$ /home/salagir/sites/lib/display.php?page=$0
</Directory>
<VirtualHost *>
ServerName myfirstsite.com
DocumentRoot /home/salagir/sites/myfirstsite.com
</VirtualHost>
<VirtualHost *>
ServerName mysecondsite.com
DocumentRoot /home/salagir/sites/mysecondsite.com
</VirtualHost>

--- 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
Back to top
Display posts from previous:   
       Webmaster Forums (Home) -> Apache
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum