I have a multisite (wordpress) consisting of 21 sites. Some are sub domains and some are URLs.
I'm now going to move the entire multisite from http to https.
What do I add to the .htaccess file?
http:// www. example .com
http:// www. example .nl
http:// www. example .de
http:// no. example .com
http:// fi. example .com
To make it even more difficult I need to move and redirect the http:// www. example .nl domain to a directory on the primary domain like https:// www. example .com/nl/
Any ideas?
Thanks
You can try following rules
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.nl [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/nl/$1 [R,L]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
Related
I just added a new site to my wordpress multisite and if www wasnt in front of the url, it redirected to my main site.
i added the following code to my htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.example.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
and now my secondary site works just fine, however my main site now redirects to the secondary one.
does anyone have any suggestions for me?
thanks
Yours will rewrite any URL without www.example.com to the new domain.
This worked for me, to rewrite all non www to example.com.
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule (.*) https://www.%{HTTP_HOST}/$1 [R=301,L]
Also, for some reason, I needed to refresh the permalinks in the child site as well.
I have a website and domain was like https://example.com. Now my domain is http://example.com. I don't want want to remove SSL certificate I will renew it after 4-5 days. So till the time how can I redirect the user from my https to http?
I tried some code in htaccess but it's not working. I am using GoDaddy hosting.
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI}
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
I am having an issue redirecting a https www domain to non www. I have a GoDaddy UCC SSL certificate and right now anyone who goes to the https www domain gets a Privacy error. I have been told that UCC certificates do no cover both www and non www domains, it's one or the other and I would have to list both on the certificate to get both covered. However there must be a better solution. Right now I have this in my htaccess file:
# BEGIN SSL
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$ [NC]
RewriteRule ^$ https://example.com$1 [R,L]
# END SSL
This will redirect http://example.com and http://www.example.com to https://example.com but the https://www.example.com still gives me the Privacy error. I have also tried:
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^ https://example.com%{REQUEST_URI} [L,NE,R=301]
and had the same problem. I checked on Redirect Mapper and it says that it should work but it doesn't. Can anyone help me out? Thanks!
I would like to redirect from non-https to https on my site and subdomains, but I'm having issues to solve it.
This is my setup:
www.domain.de
www.sub.domain.de
www.sub2.domain.de
www.sub3.domain.de
I can open all links by https and it works, but due duplicate content I would like to use https only.
RewriteEngine On
RewriteCond %{SERVER_PORT} !=443
RewriteRule ^(.*)$ https://domain.de/$1 [R=301,L]
this is my htaccess so far... but it redirects the subdomains to the primary domain :(
any ideas?
You can use:
RewriteEngine On
RewriteCond %{SERVER_PORT} !=443
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,L,R=301]
You can use this pluging: https://wordpress.org/plugins/https-redirection/
It is a simpel way to do it, it redirect everything from HTTP to HTTPS.
My webpage used to be blog.example.com, but it is now example.com. I had to delete the /blog directory (where the website hosted blog.example.com), because I have a Wordpress page at the URL example.com/blog and that screws it up.
I have tried:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^blog\.example\.com
RewriteRule ^(.*)$ http://www\.example\.com/$1 [L]
As well as:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?blog\.example\.com$ [NC]
RewriteRule ^ http://www.example.com/%{REQUEST_URI} [NE,R=301,L]
And:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^blog\.example\.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]
But none of these make any difference in the subdomain.
What can I do to redirect blog.website.com/URLS to website.com/URLS? (without creating example.com/blog because it will mess up Wordpress's webpage website.com/blog)
I figured it out! I had to:
Remove the redirect from bluehost that was supposed to redirect the
subdomain to the main domain
Create the subdomain blog.example.com at the directory at public_html/blog-redirect
Add this redirect code to the .htacces file under /blog-redirect:
RewriteEngine On
RedirectMatch 301 ^/(.*)$ http://example.com/$1