NoCase option for non-regex pattern '-d' is not supported

Using a single web hosting account to host multiple sites

Simular issuee

Postby arnoldnijboer » Sun Dec 28, 2008 5:12 am

Hey Guys i'm having the same isseu wel not exactly.. let me explain:
i'm using:
RewriteCond %{HTTP_HOST} ^([^\.]+)\.Arnoldnijboer\.info$ [NC]
RewriteCond %{DOCUMENT_ROOT}/%1 -d [NC]
RewriteCond %1%{REQUEST_URI} !^([^\.]+)/\1(/.*)?$
RewriteRule ^(.*)$ %1/$1 [L,NC,QSA]

but my log says for every time:
[Sun Dec 28 12:48:37 2008] [warn] RewriteCond: NoCase option for non-regex pattern '-d' is not supported and will be ignored.

but if i leave the -d opperant out it doesn't work?!
arnoldnijboer
 
Posts: 4
Joined: Sun Dec 28, 2008 4:57 am

Postby richardk » Sun Dec 28, 2008 9:16 am

You have to remove [NC] and leave -d.

A better version of that mod_rewrite
Code: Select all
Options +FollowSymLinks

RewriteEngine On

# Fix missing trailing slashes.
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.example\.com$ [NC]
RewriteCond %{DOCUMENT_ROOT}/%2%{REQUEST_URI}/ -d
RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L]

# Rewrite sub domains.
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.example\.com$ [NC]
RewriteCond %{DOCUMENT_ROOT}/%2 -d
RewriteRule ^(.*)$ /%2/$1 [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby arnoldnijboer » Sun Dec 28, 2008 9:27 am

Thanks for the pointer.

can you explain what's better? i'm not that good at mod-rewrite
all i see is a lot of special characters.

and perhaps you can help me with another issue related so to speak.
i'm using squirrelmail a webmail php program.
but it can't deal with mod-rewrite, or apache isn't functioning properly i don't know yet.
but when i go to webmail.domainname.com i can't login or it says a bad login.
but when i go to domainname.com/webmail or webmail.domainname.com/webmail than i can login.

is this a fault in apache or in mod-rewrite or perhaps in squirrelmail?
thanks.. arnold
arnoldnijboer
 
Posts: 4
Joined: Sun Dec 28, 2008 4:57 am

Postby richardk » Sun Dec 28, 2008 9:43 am

Does the work with any sub domain?
Does this mod_rewrite test work?
What is the squirrelmail login form's form action=""?

If is better because it adds missing trailing slashes. Otherwise a request to abc.example.com/directory would be redirected to example.com/abc/directory/ instead of abc.example.com/directory/.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby arnoldnijboer » Thu Jan 01, 2009 11:09 am

Hey i've tested it.
it works better indeed.. i like it.

but for some reason is you take the php code
Code: Select all
$php_self

php doesn't follow the modrewrite it stil displays the %2 directory so to say.

i've installed squirrelmail now separate for every domain and configured the base_uri by hand. hope they don't update to regularly :P

by the way i've removed
Code: Select all
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]

because my www is also a subdirectory/subdomain. so i need it to be rewritten as well.

Thanks for the help.
arnoldnijboer
 
Posts: 4
Joined: Sun Dec 28, 2008 4:57 am

Postby richardk » Thu Jan 01, 2009 5:21 pm

but for some reason is you take the php code
Code: Select all
$php_self

php doesn't follow the modrewrite it stil displays the %2 directory so to say.

That is normal behaviour because internally the %2 directory exists.

i've installed squirrelmail now separate for every domain and configured the base_uri by hand. hope they don't update to regularly

Couldn't you install it once and use an IF statement to set the base URL?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby arnoldnijboer » Fri Jan 02, 2009 12:33 am

Couldn't you install it once and use an IF statement to set the base URL?

an easier way would be to remove the
Code: Select all
$php_self
from the squirrelmail code.
but i wouldn't want to change the basic code, this makes updating even worse.

i'll think i will manage...
arnoldnijboer
 
Posts: 4
Joined: Sun Dec 28, 2008 4:57 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 18 guests

cron