JRA Posted September 12, 2018 Posted September 12, 2018 (edited) Hi all, We've had a new website developed for us by an external company. There seems to be an issue with fonts and icons not loading on initially visiting the website, which then go on to work when a link is clicked. The developers of the theme suggested that I redirect non-www traffic to www in Apache itself. After googling up just what on earth that meant, I've brewed up the following: [font=arial][/font] [font=arial] ServerName mysite.co[url="http://longhill.org.uk/"].[/url]uk[/font] [font=arial] Redirect permanent / [url="http://mysite.co.uk/"]http://www.mysite.co.uk/[/url][/font] [font=arial][/font] [font=arial] [/font] [font=arial][/font] [font=arial] ServerName [url="http://www.mysite.co.uk"]www.mysite.co.uk[/url][/font] [font=arial][/font] Will this achieve what I want to do or no? Thanks any and everyone! Edited September 12, 2018 by JRA
derf Posted September 13, 2018 Posted September 13, 2018 That should work correctly. I use the same to force to https 1
Arthur Posted September 13, 2018 Posted September 13, 2018 (edited) We've had a new website developed for us by an external company. If it's a brand new website shouldn't it be redirecting to the HTTPS version of the site (https://www.mysite.co.uk)? Edited September 13, 2018 by Arthur 1
JRA Posted September 13, 2018 Author Posted September 13, 2018 That should work correctly. I use the same to force to https Ta! I'll stuff that in. If it's a brand new website shouldn't it be redirecting to the HTTPS version of the site (https://www.mysite.co.uk)? Well the site itself I'm not sure entirely needs that, but the remote desktop and portal sites etc do have ssl. I've got the wildcard cert so meh, might plumb it in. Thanks much to you both.
powdarrmonkey Posted November 25, 2018 Posted November 25, 2018 Redirect permanent / http://www.mysite.co.uk/ Will this achieve what I want to do or no? Only for the bare URI, no pages or other assets. You don't need a second virtualhost either. Better: ServerName mysite.co.uk ServerAlias www.mysite.co.uk RewriteEngine on RewriteCond "%{HTTP_HOST}" "!^www\.mysite\.co\.uk" [NC] RewriteCond "%{HTTP_HOST}" "!^$" RewriteRule "^/?(.*)" "http://www.mysite.co.uk/$1" [L,R=301]
mavhc Posted November 25, 2018 Posted November 25, 2018 Make everything https while you're at it, stops people injecting malware/ads/tracking
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now