Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rewrite on Windows-server (subdomain)

Status
Not open for further replies.

dennismdk

Programmer
Feb 16, 2006
6
DK
I have this rewrite rule:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^([^.]+)\.myhp\.dk$
RewriteCond %{1} !^www$
RewriteCond c:/ -d
RewriteCond %{REQUEST_FILENAME} !^c:/RewriteRule (.*) c:/ [l]

It's placed in my .htaccess on
When I visit myhp.dk it works but when I try to visit ns-ekstra.myhp.dk e.g. I get this error:

You don't have permission to access /c:/ on this server.

Can anybody help me to get this rewrite work?
I would like to lead users who vist asubdomain.myhp.dk to myhp.dk/asubdomain.
 
Hi

Be patient. Nobody will answer just because you hurry them. If someone knows the answer and has time, will probably reply.

Until that, set the [tt]RewriteLogLevel[/tt] to something higher and the log will help you.

Feherke.
 
Hei,

I have searched for RewriteLogLevel in either httpd.conf and php.ini. But there is nothing to find.
Could I write RewriteLogLevel in the bottom of httpd.conf? Which value?
 
I get this error in my log:

<small>80.164.67.235 - - [02/Mar/2006:14:18:35 +0100] [admin.myhp.dk/sid#602558][rid#c52b38/initial] (3) [per-dir C:/www/myhp.dk/www/] strip per-dir prefix: C:/ ->
80.164.67.235 - - [02/Mar/2006:14:18:35 +0100] [admin.myhp.dk/sid#602558][rid#c52b38/initial] (3) [per-dir C:/www/myhp.dk/www/] applying pattern '(.*)' to uri ''
80.164.67.235 - - [02/Mar/2006:14:18:35 +0100] [admin.myhp.dk/sid#602558][rid#c52b38/initial] (2) [per-dir C:/www/myhp.dk/www/] rewrite -> c:/80.164.67.235 - - [02/Mar/2006:14:18:35 +0100] [admin.myhp.dk/sid#602558][rid#c52b38/initial] (3) [per-dir C:/www/myhp.dk/www/] add per-dir prefix: c:/ -> C:/80.164.67.235 - - [02/Mar/2006:14:18:35 +0100] [admin.myhp.dk/sid#602558][rid#c52b38/initial] (2) [per-dir C:/www/myhp.dk/www/] strip document_root prefix: C:/ -> /c:/80.164.67.235 - - [02/Mar/2006:14:18:35 +0100] [admin.myhp.dk/sid#602558][rid#c52b38/initial] (1) [per-dir C:/www/myhp.dk/www/] internal redirect with /c:/ [INTERNAL REDIRECT]</small>

It's easy to see that the rewrite make a mistake and end up with:
/c:/
It should just be:
c:/
Can you helt me to understand the log and edit my rewriterules?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top