Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirecting from secure www to secure non-www #15

Closed
gavinworks opened this issue Jan 3, 2019 · 2 comments
Closed

Redirecting from secure www to secure non-www #15

gavinworks opened this issue Jan 3, 2019 · 2 comments

Comments

@gavinworks
Copy link

Hi,

First... we're amazed how incredible this piece of GENIUS is. Thanks so much for making this available.

Not sure if this may be possible with the plugin but we have the following scenario. We have old urls cached in google when our security cert matched urls with https://www.example.com/example-page. With our new site we abandonded www. in favour of https://example.com. So the redirect we want to happen is:

https://www.example.com/example-page --> https://example.com/example-page

However when the user hits https://www. (because it's no longer covered by the cert) the browser warns that the SSL cert is invalid (which we'd expect it to) and connection is not private and doesn't redirect to our non-www url. Is there anything within the plugin that will allow us to redirect in this manner? Tried playing around with advanced settings tab but to no avail I'm afraid.

Any help/tips you can give would be greatly appreciated.

Thanks
Gavin

@adrenth
Copy link
Contributor

adrenth commented Jan 3, 2019

Hi Gavin,

Thank you for the compliments. Love to hear it!

For this specific case:

The SSL certificate is validated first (client-side) before executing any script on the webserver. The browser prevents the request from executing. So it will not execute the redirect engine. Unless the user makes an exception.

My advice to you is handle this issue from .htaccess (if your host is running Apache).

See: https://stackoverflow.com/questions/234723/generic-htaccess-redirect-www-to-non-www

I always handle such things (www to non-www and http to https) with the .htaccess file or webserver configuration.

@gavinworks
Copy link
Author

Hi Alwin

You're very welcome. Thanks for the super-fast reply!

I guessed as much... we're running NGINX though not apache. I'll see if Google turns up some more answers. Many thanks for pointing me in the right direction :)

Best wishes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants