0

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/

3
  • create rule in .htacess file
    – Yogesh
    Oct 27, 2017 at 12:01
  • could you please delete questions like this???
    – MagenX
    Oct 27, 2017 at 15:47
  • Look your DNS and .htaccess rules @Pratik Kamani
    – PЯINCƎ
    Nov 9, 2017 at 13:02

3 Answers 3

1
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

4

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".

0

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).

Not the answer you're looking for? Browse other questions tagged or ask your own question.