Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

rewrite problem with name virtual hosts

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Next:  Newbie: images are not loaded completely  
Author Message
user2532

External


Since: Oct 27, 2003
Posts: 3



(Msg. 1) Posted: Mon Oct 27, 2003 2:13 pm
Post subject: rewrite problem with name virtual hosts
Archived from groups: alt>apache>configuration (more info?)

Hi list,

i have a little problem. I am using Apache 1.3, php4 perl and ssl.
I've got several name virtual hosts all listen on the same ip address.
I use mod rewrite to simulate static web pages. I put in the same
rewrite rules in a couple of virtual hosts, but it does only work for
the first entry. Does someone know this problem and has an idea how to
solve it.
Help welcomed. Thanks
Regards Markus
--
Markus
www.xsys.biz

 >> Stay informed about: rewrite problem with name virtual hosts 
Back to top
Login to vote
davideyeahsure

External


Since: Nov 03, 2003
Posts: 2907



(Msg. 2) Posted: Mon Oct 27, 2003 2:13 pm
Post subject: Re: rewrite problem with name virtual hosts [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Markus Bender <idontwantspam-leftstart-markus.bender.DeleteThis@xsys.biz-rightstop> wrote:
 > I use mod rewrite to simulate static web pages. I put in the same
 > rewrite rules in a couple of virtual hosts, but it does only work for
 > the first entry.

It sounds like a configuration problem. Post the relevant part of your
configuration file.

Davide<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: rewrite problem with name virtual hosts 
Back to top
Login to vote
user2532

External


Since: Oct 27, 2003
Posts: 3



(Msg. 3) Posted: Mon Oct 27, 2003 7:00 pm
Post subject: Re: rewrite problem with name virtual hosts [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 27 Oct 2003 10:25:22 GMT, Davide Bianchi
<davideyeahsure.DeleteThis@onlyforfun.net> wrote:


 >It sounds like a configuration problem. Post the relevant part of your
 >configuration file.

Hi Davide,
here is the part of my httpd.conf
the first host <a style='text-decoration: underline;' href="http://www.firsthost.com" target="_blank">www.firsthost.com</a> works just fine, the rest doesn't


  NameVirtualHost 192.168.200.50

  <VirtualHost 192.168.200.50:80>
  DocumentRoot /srv/www/firsthost/cms-web/
<font color=purple>  ServerName <a style='text-decoration: underline;' href="http://www.firsthost.com</font" target="_blank">www.firsthost.com</font</a>>
  ScriptAlias /cgi-bin /srv/www/firsthost/cgi-bin
  RewriteEngine on
  RewriteRule ^[^/]*\.html$ /index.php
  ErrorDocument 404 /index.php
  </VirtualHost>


  <VirtualHost 192.168.200.50>
  DocumentRoot "/srv/www/secondhost"
<font color=purple>  ServerName <a style='text-decoration: underline;' href="http://www.secondhost.de</font" target="_blank">www.secondhost.de</font</a>>
  RewriteEngine on
  RewriteRule ^[^/]*\.html$ /index.php
  </VirtualHost>


  <VirtualHost 192.168.200.50>
  DocumentRoot /srv/www/firsthost/cms-web/
<font color=purple>  ServerName <a style='text-decoration: underline;' href="http://www.firsthost.net</font" target="_blank">www.firsthost.net</font</a>>
  RewriteEngine on
  RewriteRule ^[^/]*\.html$ /index.php
  </VirtualHost>

  <VirtualHost 192.168.200.50:80>
  DocumentRoot /srv/www/firsthost/cms-web/
<font color=purple>  ServerName <a style='text-decoration: underline;' href="http://www.firsthost.de</font" target="_blank">www.firsthost.de</font</a>>
  RewriteEngine on
  RewriteRule ^[^/]*\.html$ /index.php
  </VirtualHost>

Thank you for your help
Markus
--
Markus
<a style='text-decoration: underline;' href="http://www.xsys.biz" target="_blank">www.xsys.biz</a><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: rewrite problem with name virtual hosts 
Back to top
Login to vote
davideyeahsure

External


Since: Nov 03, 2003
Posts: 2907



(Msg. 4) Posted: Mon Oct 27, 2003 7:00 pm
Post subject: Re: rewrite problem with name virtual hosts [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Markus Bender <idontwantspam-leftstart-markus.bender.DeleteThis@xsys.biz-rightstop> wrote:
 > the first host <a style='text-decoration: underline;' href="http://www.firsthost.com" target="_blank">www.firsthost.com</a> works just fine, the rest doesn't
  > NameVirtualHost 192.168.200.50
  > <VirtualHost 192.168.200.50:80>

Hummm... mixing specified port and non-specified port isn't a good idea.
I'd rewrite the whole thing using "*" instead of the IP address and
leaving out the :80, this _unless_ you run apache on multiple ports
and you want to distinguish between services/hosts that way.
Use apachectl configtest to check the configuration file.

  > DocumentRoot "/srv/www/secondhost"
<font color=green>  > ServerName <a style='text-decoration: underline;' href="http://www.secondhost.de</font" target="_blank">www.secondhost.de</font</a>>
  > RewriteEngine on
  > RewriteRule ^[^/]*\.html$ /index.php

Add a rewritelog directive just to see if the rule is processed or not.

Davide<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: rewrite problem with name virtual hosts 
Back to top
Login to vote
user2532

External


Since: Oct 27, 2003
Posts: 3



(Msg. 5) Posted: Thu Oct 30, 2003 7:14 pm
Post subject: Re: rewrite problem with name virtual hosts [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

 >the first host <a style='text-decoration: underline;' href="http://www.firsthost.com" target="_blank">www.firsthost.com</a> works just fine, the rest doesn't
 >
 >
  > NameVirtualHost 192.168.200.50
 >
  > <VirtualHost 192.168.200.50:80>
  > DocumentRoot /srv/www/firsthost/cms-web/
<font color=green>  > ServerName <a style='text-decoration: underline;' href="http://www.firsthost.com</font" target="_blank">www.firsthost.com</font</a>>
  > ScriptAlias /cgi-bin /srv/www/firsthost/cgi-bin
  > RewriteEngine on
  > RewriteRule ^[^/]*\.html$ /index.php
  > ErrorDocument 404 /index.php
  > </VirtualHost>
 >
 >
  > <VirtualHost 192.168.200.50>
  > DocumentRoot "/srv/www/secondhost"
<font color=green>  > ServerName <a style='text-decoration: underline;' href="http://www.secondhost.de</font" target="_blank">www.secondhost.de</font</a>>
  > RewriteEngine on
  > RewriteRule ^[^/]*\.html$ /index.php
  > </VirtualHost>
 >
 >
  > <VirtualHost 192.168.200.50>
  > DocumentRoot /srv/www/firsthost/cms-web/
<font color=green>  > ServerName <a style='text-decoration: underline;' href="http://www.firsthost.net</font" target="_blank">www.firsthost.net</font</a>>
  > RewriteEngine on
  > RewriteRule ^[^/]*\.html$ /index.php
  > </VirtualHost>
 >

Hi,

well what I think is really strange, is the fact that the same rewrite
rule which worked for <a style='text-decoration: underline;' href="http://www.firsthost.com" target="_blank">www.firsthost.com</a> doesn't work for
<a style='text-decoration: underline;' href="http://www.firsthost.net," target="_blank">www.firsthost.net,</a> although they both point to the same directory!

However I did a request for the working rewrite rule:

192.168.x.x - - [30/Oct/2003:15:27:03 +0100]
[www.firsthost.com/sid#816c580][rid#8413978/initial] (2) init rewrite
engine with requested uri /6.0.html
192.168.x.x - - [30/Oct/2003:15:27:03 +0100]
[www.firsthost.com/sid#816c580][rid#8413978/initial] (3) applying
pattern '^[^/]*\.html$' to uri '/6.0.html'
192.168.x.x - - [30/Oct/2003:15:27:03 +0100]
[www.firsthost.com/sid#816c580][rid#8413978/initial] (1) pass through
/6.0.html
192.168.x.x - - [30/Oct/2003:15:27:03 +0100]
[www.firsthost.com/sid#816c580][rid#841ee88/initial/redir#1] (2) init
rewrite engine with requested uri /index.php
192.168.x.x - - [30/Oct/2003:15:27:03 +0100]
[www.firsthost.com/sid#816c580][rid#841ee88/initial/redir#1] (3)
applying pattern '^[^/]*\.html$' to uri '/index.php'
192.168.x.x - - [30/Oct/2003:15:27:03 +0100]
[www.firsthost.com/sid#816c580][rid#841ee88/initial/redir#1] (1) pass
through /index.php


And now for the non-working rewrite rule beginning with go to url
<a style='text-decoration: underline;' href="http://www.secondhost.de:" target="_blank">www.secondhost.de:</a>

192.168.0.1 - - [30/Oct/2003:15:28:15 +0100]
[www.secondhost.de/sid#85a50c0][rid#8413978/initial] (2) init rewrite
engine with requested uri /
192.168.0.1 - - [30/Oct/2003:15:28:15 +0100]
[www.secondhost.de/sid#85a50c0][rid#8413978/initial] (3) applying
pattern '^[^/]*\.html$' to uri '/'
192.168.0.1 - - [30/Oct/2003:15:28:15 +0100]
[www.secondhost.de/sid#85a50c0][rid#8413978/initial] (1) pass through
/
192.168.0.1 - - [30/Oct/2003:15:28:15 +0100]
[www.secondhost.de/sid#85a50c0][rid#8415990/subreq] (2) init rewrite
engine with requested uri /index.html
192.168.0.1 - - [30/Oct/2003:15:28:15 +0100]
[www.secondhost.de/sid#85a50c0][rid#8415990/subreq] (3) applying
pattern '^[^/]*\.html$' to uri '/index.html'
192.168.0.1 - - [30/Oct/2003:15:28:15 +0100]
[www.secondhost.de/sid#85a50c0][rid#8415990/subreq] (1) pass through
/index.html
192.168.0.1 - - [30/Oct/2003:15:28:15 +0100]
[www.secondhost.de/sid#85a50c0][rid#8415990/subreq] (2) init rewrite
engine with requested uri /index.php
192.168.0.1 - - [30/Oct/2003:15:28:15 +0100]
[www.secondhost.de/sid#85a50c0][rid#8415990/subreq] (3) applying
pattern '^[^/]*\.html$' to uri '/index.php'
192.168.0.1 - - [30/Oct/2003:15:28:15 +0100]
[www.secondhost.de/sid#85a50c0][rid#8415990/subreq] (1) pass through
/index.php
192.168.0.1 - - [30/Oct/2003:15:28:15 +0100]
[www.secondhost.de/sid#85a50c0][rid#841da38/initial/redir#1] (2) init
rewrite engine with requested uri /index.php
192.168.0.1 - - [30/Oct/2003:15:28:15 +0100]
[www.secondhost.de/sid#85a50c0][rid#841da38/initial/redir#1] (3)
applying pattern '^[^/]*\.html$' to uri '/index.php'
192.168.0.1 - - [30/Oct/2003:15:28:15 +0100]
[www.secondhost.de/sid#85a50c0][rid#841da38/initial/redir#1] (1) pass
through /index.php
192.168.0.1 - - [30/Oct/2003:15:28:15 +0100]
[www.secondhost.de/sid#85a50c0][rid#8413978/initial] (2) init rewrite
engine with requested uri /fileadmin/template/res/styles.css
192.168.0.1 - - [30/Oct/2003:15:28:15 +0100]
[www.secondhost.de/sid#85a50c0][rid#8413978/initial] (3) applying
pattern '^[^/]*\.html$' to uri '/fileadmin/template/res/styles.css'
192.168.0.1 - - [30/Oct/2003:15:28:15 +0100]
[www.secondhost.de/sid#85a50c0][rid#8413978/initial] (1) pass through
/fileadmin/template/res/styles.css
192.168.0.1 - - [30/Oct/2003:15:28:15 +0100]
[www.secondhost.de/sid#85a50c0][rid#8413978/initial] (2) init rewrite
engine with requested uri /fileadmin/template/res/images/logo.gif
192.168.0.1 - - [30/Oct/2003:15:28:15 +0100]
[www.secondhost.de/sid#85a50c0][rid#8413978/initial] (3) applying
pattern '^[^/]*\.html$' to uri
'/fileadmin/template/res/images/logo.gif'
192.168.0.1 - - [30/Oct/2003:15:28:15 +0100]
[www.secondhost.de/sid#85a50c0][rid#8413978/initial] (1) pass through
/fileadmin/template/res/images/logo.gif
192.168.0.1 - - [30/Oct/2003:15:28:15 +0100]
[www.secondhost.de/sid#85a50c0][rid#8413978/initial] (2) init rewrite
engine with requested uri /clear.gif
192.168.0.1 - - [30/Oct/2003:15:28:15 +0100]
[www.secondhost.de/sid#85a50c0][rid#8413978/initial] (3) applying
pattern '^[^/]*\.html$' to uri '/clear.gif'
192.168.0.1 - - [30/Oct/2003:15:28:15 +0100]
[www.secondhost.de/sid#85a50c0][rid#8413978/initial] (1) pass through
/clear.gif




Here I tried to use a link:

192.168.0.1 - - [30/Oct/2003:15:28:17 +0100]
[www.secondhost.de/sid#85a50c0][rid#8413978/initial] (2) init rewrite
engine with requested uri /34.0.html
192.168.0.1 - - [30/Oct/2003:15:28:17 +0100]
[www.secondhost.de/sid#85a50c0][rid#8413978/initial] (3) applying
pattern '^[^/]*\.html$' to uri '/34.0.html'
192.168.0.1 - - [30/Oct/2003:15:28:17 +0100]
[www.secondhost.de/sid#85a50c0][rid#8413978/initial] (1) pass through
/34.0.html


Hope someone can help.
Regards
Markus
--
One OS to rule them all, One OS to find them,
One OS to bring them all and in the darkness bind them.

<a style='text-decoration: underline;' href="http://www.xsys.biz" target="_blank">www.xsys.biz</a><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: rewrite problem with name virtual hosts 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Virtual Hosts Problem - Hi Group, I'm having trouble getting Virtual Hosts to work on my Mandrake 9,1 box. I'm using the Advx release of Apache for Mandrake, and it switches between 1.3x and 2.0.x (currently 2.0.44) by executing one of two scripts. I've followed a lot of the..

virtual hosts problem.. - hi, After Kerio + windows managed to delete my whole webserver, I've had to reinstall the lot.. However, I'm having a few problems with stuff... I have the virtual hosts working again, but cgi scripts are not working in all of them... I have WinXP +....

Problem with Virtual Hosts for Windows on Apache 2 - I cannot get the virutal hosts to work with Apache2 on my windows server. This is the configuration I have. Does anyone have experience configuring a Win2K machine? NameVirtualHost 219.250.125.145 &lt;VirtualHost 219.250.125.145&gt; ..

Virtual Hosts - Hi everyone, I am new to apache, so if my question is answered in the groups faq, or on the apache web site, feel free to tell me to f**k off and read there. However I have looked through the manual, and cant find any reference to the issues im having...

Virtual hosts and SSL? - Hello I'm trying to setup this apache 1.3 server for virtual hosts, with ssl. I've got the normal port 80 working, but the SSL is a bit of a mess. If I have the SSL pages in the real part of the server, ie, https://www.example.com/fred/index.htm then....
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can 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



[ Contact us | Terms of Service/Privacy Policy ]