This question has been archived.

Non WWW to WWW redirect loop

April 4, 2015 2.2k views
Apache DNS Ubuntu

Hi guys.
Just created droplet with Ubuntu (14.04) and have OpenCart installation with Apache as described on this site.

Everything is looks OK on, but if I goes to domain, I get "Font from origin '' has been blocked from loading by Cross-Origin Resource Sharing policy".

Made some (very long) search (it's my first day with servers) and got a solution : to redirect non WWW to WWW.

My /etc/apache2/sites-available/000-default.conf:

<VirtualHost *:80>
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

## Added by me
# ServerAlias
# Redirect permanent /

Tried the "ServerAlias" but doesn't helps.
If I uncomment this line "Redirect permanent /" and restarts the server, when I goes to it redirects me ( 301 ) to but I get "This webpage has a redirect loop", and in dev tools: too many redirects.

Tried changes on .htaccess in /var/www/html/ but it looks doesn't work at all (adding and removing junk chars does not make changes)

What can be the next step to resolve the issue?
Is there some more information that I need to provide?

Thank you in advance for your time.

1 comment
Be the first one to answer this question.