Re: Rewrite rules question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The following works for me

RewriteCond %{SERVER_PORT}  ^80$
RewriteRule ^(.*)$ https://www.domain.com.au$1 [R=301,L]


Cheers,

Igor

On Thu, Apr 23, 2009 at 8:07 AM, André Warnier <aw@xxxxxxxxxx> wrote:
John Oliver wrote:
A site has the following rules:

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

I've been asked to ensure that www.domain.com goes to https://domain.com
so I tried:

RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} !^domain\.com$ [NC]
RewriteRule ^(.*)$ https://domain.com/$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

And:

RewriteEngine on
RewriteBase /
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

Neither of those is working. Nothing is getting written to any logs. I'm
not certain that you can or can not "stack" rules like that.

You could start by having a look at the RewriteLog and RewriteLogLevel directives.  It's not really possible that nothing would get logged, unless you are not even hitting the rules above.
Also, *where* are the above directives ?



---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
 "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux