You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Alexander Stoll <te...@gmx.de> on 2004/07/20 14:31:00 UTC

[users@httpd] Alltimer mod_rewrite

Hello Listmembers,

I´m a bit stuck in fiddling my rewrite rules...

What I want to do:

For hosting several Typo3 sites several working vhosts are present, I´d 
like the backend via SSL so I map the backends of the vhosts to 
directory of one SSL vhost via a redirect in each vhost. So far so good, 
this is working fine, but when a preview of the frontend page is 
requested I need to rewrite the request back to the normal vhost...

in ssl.conf :

Alias /typo3ssl-site1 /vhosts/www.site1.de/webroot/typo3
# alias for backend directory of normal vhost to directory on SSL vhost

RewriteEngine   on
RewriteLog      /root/rlog
RewriteLogLevel 9
RewriteCond    %{HTTP_REFERER} !^$
RewriteCond    %{HTTP_REFERER} 
^/typo3ssl-site1/ext/viewpage/view/frameset.php.*
RewriteRule    ^index.php(.*)$ http://www.site1.de/$1   [R]

<Directory /vhosts/www.site1.de/webroot/typo3>
RewriteBase /typo3ssl-site1
</Directory>

my referer is :
https://sslhost.server.de/typo3ssl-site1/ext/viewpage/view/frameset.php?&id=0

which requested:
https://sslhost.server.de/index.php?id=0

but this needs to be:
http://www.site1.de/index.php?id=0

the rewrite log is empty, nothing in there...

Maybe someone can point me to the proper solution...

Regards, AS


---------------------------------------------------------------------
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


Re: [users@httpd] Alltimer mod_rewrite

Posted by Alexander Stoll <te...@gmx.de>.
Eimantas Vaiciunas schrieb:
> On Tuesday 20 July 2004 14:31, Alexander Stoll wrote:
> 
>>RewriteEngine   on
>>RewriteLog      /root/rlog
>>RewriteLogLevel 9
> 
> 
>>the rewrite log is empty, nothing in there...
> 
> 
> try writing your rewrite log to non-priviledged user directory (like /var/log, 
> or smth) and i think it should be enough RewriteLogLevel 4 if you're not 
> using any rewrite maps.
this doesn´t affect the log, it´s empty with level 9, nothing happend...
Shouldn´t I see anything in the log ? The Module is loaded...

Any hints?


---------------------------------------------------------------------
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


Re: [users@httpd] Alltimer mod_rewrite

Posted by Eimantas Vaiciunas <ei...@sc.vu.lt>.
On Tuesday 20 July 2004 14:31, Alexander Stoll wrote:
> RewriteEngine   on
> RewriteLog      /root/rlog
> RewriteLogLevel 9

> the rewrite log is empty, nothing in there...

try writing your rewrite log to non-priviledged user directory (like /var/log, 
or smth) and i think it should be enough RewriteLogLevel 4 if you're not 
using any rewrite maps.


---------------------------------------------------------------------
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


Re: [users@httpd] Alltimer mod_rewrite

Posted by Alexander Stoll <te...@gmx.de>.
Joshua Slive schrieb:

> I don't understand exactly what you are trying to do, but if the 
> rewritelog is empty, you have a major problem.
I try to make it more transparent:
I want to host several Typo3 CMS sites via NamevirtualHosts(80), the 
administratration backend resides in a directory which is redirected to 
a SSL enabled vhost(443), all vhost backends are mapped to directories 
of the SSL vhost (I want to waste only 1 IP / serversystem).
Each backend has its docroot under their own directory on the SSL vhost 
and is generating a preview of the edited content which have to be 
redirected to the original vhost where the normal site resides...
The redirect should be triggered only if the referer is the script which 
calls the preview URL...


> To start, are the mod_rewrite directives inside or outside the
> <VirtualHost> section? If they are outside, you need to use a
> RewriteOptions directive inside the <VirtualHost> to get the
> directives to carry through.
that´s a point I missed, I´ll check it...

> Also, using both Alias and RewriteRules together in this way is not a
> good idea.  You wind up getting confusing stuff happening due to 
> module hook ordering.  You are better off convertin the Alias to a 
> RewriteRule so you can explicitly specify the ordering.
that´s something I thougt of to do before go live in productive 
environment, thanks for pushing me to do it now :-)

Thanks for this useful hint, if I run into a new tarpit, I scream for 
more help ;-)




---------------------------------------------------------------------
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


Re: [users@httpd] Alltimer mod_rewrite

Posted by Joshua Slive <js...@gmail.com>.
On Tue, 20 Jul 2004 14:31:00 +0200, Alexander Stoll <te...@gmx.de> wrote:

> Alias /typo3ssl-site1 /vhosts/www.site1.de/webroot/typo3
> # alias for backend directory of normal vhost to directory on SSL vhost
> 
> RewriteEngine   on
> RewriteLog      /root/rlog
> RewriteLogLevel 9
> RewriteCond    %{HTTP_REFERER} !^$
> RewriteCond    %{HTTP_REFERER}
> ^/typo3ssl-site1/ext/viewpage/view/frameset.php.*
> RewriteRule    ^index.php(.*)$ http://www.site1.de/$1   [R]
> 
> <Directory /vhosts/www.site1.de/webroot/typo3>
> RewriteBase /typo3ssl-site1
> </Directory>

> the rewrite log is empty, nothing in there...

I don't understand exactly what you are trying to do, but if the
rewritelog is empty, you have a major problem.  To start, are the
mod_rewrite directives inside or outside the <VirtualHost> section? 
If they are outside, you need to use a RewriteOptions directive inside
the <VirtualHost> to get the directives to carry through.

Also, using both Alias and RewriteRules together in this way is not a
good idea.  You wind up getting confusing stuff happening due to
module hook ordering.  You are better off convertin the Alias to a
RewriteRule so you can explicitly specify the ordering.

Joshua.

---------------------------------------------------------------------
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