redirect all requests whilst maintaining security
3 posts
• Page 1 of 1
- mooterminer
- Posts: 2
- Joined: 10 May 2012, 07:35
redirect all requests whilst maintaining security
Hi there,
I have a simple problem but I just cannot see a way to do it.
I want all pages to redirect to a new domain whilst keep the SSL (or lack of SSL).
So:
http://olddomain.com/welcome.aspx
becomes:
http://newdomain.com/welcome.aspx
AND:
https://olddomain.com/welcome.aspx
becomes:
https://newdomain.com/welcome.aspx
I currently have:
RewriteCond %{HTTP:Host} (olddomain.com)
RewriteRule (.*) http://newdomain-ascent.com/$1 [R=301,NC,L]
This works but sends all https://olddomain to http://newdomain (drops the https)
Please, if anyone can help me I would very much appreciate it - it's doing my head in!
thanks,
jim
I have a simple problem but I just cannot see a way to do it.
I want all pages to redirect to a new domain whilst keep the SSL (or lack of SSL).
So:
http://olddomain.com/welcome.aspx
becomes:
http://newdomain.com/welcome.aspx
AND:
https://olddomain.com/welcome.aspx
becomes:
https://newdomain.com/welcome.aspx
I currently have:
RewriteCond %{HTTP:Host} (olddomain.com)
RewriteRule (.*) http://newdomain-ascent.com/$1 [R=301,NC,L]
This works but sends all https://olddomain to http://newdomain (drops the https)
Please, if anyone can help me I would very much appreciate it - it's doing my head in!
thanks,
jim
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: redirect all requests whilst maintaining security
Hello,
Please, try using the following 2 rules:
Regards
Andrew
Please, try using the following 2 rules:
- Code: Select all
# FOR https
RewriteCond %{HTTPS} on
RewriteCond %{HTTP:Host} (olddomain\.com)
RewriteRule (.*) https://newdomain-ascent.com/$1 [R=301,NC,L]
#for HTTP
RewriteCond %{HTTPS} !on
RewriteCond %{HTTP:Host} (olddomain\.com)
RewriteRule (.*) http://newdomain-ascent.com/$1 [R=301,NC,L]
Regards
Andrew
- mooterminer
- Posts: 2
- Joined: 10 May 2012, 07:35
Re: redirect all requests whilst maintaining security
Hi Andrew,
That worked an absolute treat!
Thanks for your help, it was very much appreciated
m
That worked an absolute treat!
Thanks for your help, it was very much appreciated
m
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests