Post by Jaesin » Thu Dec 12, 2019 8:07 pm

Was wondering if someone would have a look at this htaccess file and see if its in "order".
my phpconfig as the site as "HTTPS://www.sitename.com" and I am ussing a SSL certificate.
I also have a static subdomain for serving images of "static.sitename.com" and it looks to be working correctly as well.....
However I have lost my ability to show fontawesome icons on the site, due to apparently a "Missing Cross-Origin Resource Sharing (CORS) Response Header"?

In searching the web, found the following code for my HTACCESS file and added it into it.

RewriteEngine On
RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.
# [NC] is a case-insensitive match
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


The rest of the file is opencart "out of the box" for handling seo URLS....
I have attached the full file saved in a text format for the attatcment-
Thankyou for any help provided.

Attachments

saved in a text format


New member

Posts

Joined
Wed Aug 23, 2017 11:31 pm

Post by letxobnav » Thu Dec 12, 2019 10:48 pm

the CORS issues originate not from your htaccess redirects but from the url's you produce in your html, i.e. via your config.php files.
Make sure those http and https servers are correctly set to all https and www or non-www.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by Jaesin » Fri Dec 13, 2019 11:17 am

Thanks, I have the cors problem corrected now by adding the following in my HTACCESS file -
<FilesMatch ".(eot|otf|ttf|woff|woff2)">
Header always set Access-Control-Allow-Origin "*"
</FilesMatch>


Can anyone tell me if the rest of the HTACCESS rewites are in the correct sequence of order?

New member

Posts

Joined
Wed Aug 23, 2017 11:31 pm

Post by Jaesin » Thu Dec 19, 2019 4:54 am

bump?

New member

Posts

Joined
Wed Aug 23, 2017 11:31 pm

Post by letxobnav » Thu Dec 19, 2019 11:06 am

remove line 34 RewriteEngine On is already set

replace line 43 with

Code: Select all

RewriteCond %{REQUEST_URI} !.*\.(php|PHP|ico|cur|txt|mp3|webp|svg|ttf|eot|woff|woff2|gif|jpg|JPG|jpeg|JPEG|png|js|cfg|css|pdf|zip|env|tar|sql|gz|tar|exe|rar|arj|cab|iso|rpm|tbz|tgz|old|bak|backup|dump|db|7z|asp|exp|html)$

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by Jaesin » Fri Dec 20, 2019 11:17 pm

thank you!

New member

Posts

Joined
Wed Aug 23, 2017 11:31 pm
Who is online

Users browsing this forum: No registered users and 215 guests