There is a problem with www. I searched on various forums and everywhere they say that I should direct non www to www. But in my case www does not work. At this moment the site works without www. With www, only certain links similar to the sitemap appear.
I had to redirect from cpanel www to non www, and everything works fine, with one exception: don't click on www.
Example: it works perfectly with https://elegantmarket.ro
and it no longer works correctly if I access www.elegantmarket.ro directly
.httaccess is configured like this:
RewriteEngine on
Inherited RewriteOptions
# php -- BEGIN cPanel-generated handler, do not edit
# Set the "ea-php80" package as the default "PHP" programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php80 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^www\.elegantmarket\.ro$ "https\:\/\/elegantmarket\.ro\/" [R=301,L]
Does anyone have an idea what should be done to make it work correctly with www?
(if necessary, the version used is 3.0.3.9)
Thank you in advance based on your professionalism and goodwill.
I had to redirect from cpanel www to non www, and everything works fine, with one exception: don't click on www.
Example: it works perfectly with https://elegantmarket.ro
and it no longer works correctly if I access www.elegantmarket.ro directly
.httaccess is configured like this:
RewriteEngine on
Inherited RewriteOptions
# php -- BEGIN cPanel-generated handler, do not edit
# Set the "ea-php80" package as the default "PHP" programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php80 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^www\.elegantmarket\.ro$ "https\:\/\/elegantmarket\.ro\/" [R=301,L]
Does anyone have an idea what should be done to make it work correctly with www?
(if necessary, the version used is 3.0.3.9)
Thank you in advance based on your professionalism and goodwill.
Something like the following should work.
Code: Select all
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]
Last edited by ADD Creative on Fri Mar 29, 2024 6:36 am, edited 1 time in total.
It shows header blocking the stylesheet request.
View all extensions | Request custom work | Pricing | Contact Me
This might help: https://www.antropy.co.uk/blog/how-to-r ... and-https/
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Thanks, it works perfectly with this code. Although an error appears in your code and I received a message that the domain to which it was redirected was not on the server. I checked and noticed that there was an extra point. After I removed it, the code turned out to be perfect. For other people who will face the same problem, I leave the repaired and functional code below.ADD Creative wrote: ↑Thu Mar 28, 2024 8:28 amSomething like the following should work.
Code: Select all
RewriteCond %{HTTP_HOST} ^www\.example\.com$ RewriteRule ^(.*)$ https://.example.com/$1 [R=301,L]
Code: Select all
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]
www.elegantmarket.ro
https://www.elegantmarket.ro
http://www.elegantmarket.ro
https://elegantmarket.ro
http://elegantmarket.ro
Last edited by brinsteve on Fri Mar 29, 2024 5:06 am, edited 2 times in total.
Yes, sorry I left the extra . in there by mistake.brinsteve wrote: ↑Fri Mar 29, 2024 4:45 amThanks, it works perfectly with this code. Although an error appears in your code and I received a message that the domain to which it was redirected was not on the server. I checked and noticed that there was an extra point. After I removed it, the code turned out to be perfect. For other people who will face the same problem, I leave the repaired and functional code below.
For those who want to check the functionality, I leave the links here:Code: Select all
RewriteCond %{HTTP_HOST} ^www\.example\.com$ RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]
www.elegantmarket.ro
https://www.elegantmarket.ro
http://www.elegantmarket.ro
https://elegantmarket.ro
http://elegantmarket.ro
Who is online
Users browsing this forum: No registered users and 18 guests