3
votes
2answers
117 views

Apache Rewrite Rule non-www to www + http to https + remove trailing slash

I would like to accomplish the following: rewrite non-www to www redirect from http to https remove trailing slash e.g. http://example.co.uk should redirect to https://www.example.co.uk How ...
1
vote
1answer
37 views

Rewrite URL with masking from HTTP to HTTPS site (on a different server) are certs needed on first server?

I have a *:80 virtual host in Apache 2.2.15 which is just a bunch of URL rewrites like: ServerAlias foo.bar biz.baz tit.tat RewriteRule / http://somesite.com (R=301,L) ServerAlias differentsite.com ...
0
votes
0answers
64 views

HTTPS redirect to HTTP not working with 'www' subdomain

I have 2 rules on my site: one to force the www subdomain, and another to force the HTTP protocol: RewriteEngine On RewriteBase / RewriteCond %{HTTPS} =on RewriteRule ^ ...
2
votes
1answer
28 views

Apache mod_rewrite SSL vs Non-SSL

I have my site setup with two conf files (one for SSL and one for Non-SSL ) The two confs are at this gist -> https://gist.github.com/akinsgre/9645179 The Non-SSL configuration works fine. When ...
4
votes
1answer
215 views

Redirect non-www to www while preserving protocol

I am aware of the fact that there are tons of questions in this section and in server fault dealing with re-directions from non-www to www URLs. But I couldn't find one dealing with this issue while ...
2
votes
2answers
3k views

Mod Rewrite - directing HTTP/HTTPS traffic to the appropriate virtual hosts

I have an Apache2 web server (v. 2.2.16) running on Debian hosting three virtual hosts. The first two hosts are HTTP only (server1 and server2). The last host is HTTPS only (server3). My virtual host ...
8
votes
3answers
3k views

Forcing SSL and www in .htaccess

I'm looking for a way to force SSL and www. I've been able to force both separately but together I keep running into redirection issues. The following code works when handling a URL in this format: ...
4
votes
1answer
7k views

Properly force SSL with .htaccess, no double authentication

I'm trying to force SSL with .htaccess on a shared host. This means there I only have access to .htaccess and not the vhosts config. I know you can put a rule in the VirtualHost config file to force ...