Site URL is https://www.spam.com/ but unfortunately it works with https://spam.com/.
This is wrong. can anyone suggested me how we can redirect to https://www.spam.com/
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communitySite URL is https://www.spam.com/ but unfortunately it works with https://spam.com/.
This is wrong. can anyone suggested me how we can redirect to https://www.spam.com/
RewriteCond %{HTTP_HOST} ^detectachem.com$ [NC]
RewriteRule (.*) https://www.detectachem.com/$1 [R=301,L]
Place this code in htacess for more information refer this link
This is also workable solution for nginx server where you can't modified .htaccess file.
Please go to Database and check table name core_config_data
, under column 'path' check
web/unsecure/base_url
web/secure/base_url
Change that rows value to specific url would you like to make for your website.
"Don't Forgot to refresh cache and indexing".
Changing the unsecured base URL to https will change all links and redirect non-https requests to https://example.com/ (the homepage) because that's what Magento does when the base URL validation fails.
So this is a good start but to also redirect http://example.com/foo/ to https://example.com/foo/ you need to do it via web server redirect.
For example, add the following code at the top of your .htaccess:
RewriteCond %{HTTPS} off RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE] Or if you use a reverse proxy like Varnish:
RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteCond %{HTTPS} off RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE] This is because the requests from Varnish to Magento will be without SSL (HTTP), but Varnish sets the X-Forwarded-Proto header to "https" if the original request was made with SSL (HTTPS).