johnsmith153 Posted May 17, 2012 Share Posted May 17, 2012 Hi, I know there is something in (1) ensuring all links on your site have the trailing slash (wasting server resources) and (2) ensuring you don't allow access to both www.domain.com and domain.com (probably SEO purposes). I also want the site to be https/SSL only, across all pages. I want to ensure everyone correctly views https://www.domain.com/. I'm guessing this is a .htaccess thing? I am on a cloud server so have no more control than that anyway. If I currently go to domain.com on my site then it automatically adds the trailing slash (which I'm guess is why links should be to domain.com/ to prevent this wasteful server action), but if I type in domain.com/page it doesn't redirect (add the trailing /). Should it? If I can ensure htaccess just redirects everyone to https://www.domain.com/page/ then I think that may be it. How would I do this? Link to comment https://forums.phpfreaks.com/topic/262648-domaincom-to-go-to-httpswwwdomaincom/ Share on other sites More sharing options...
requinix Posted May 17, 2012 Share Posted May 17, 2012 If I currently go to domain.com on my site then it automatically adds the trailing slash (which I'm guess is why links should be to domain.com/ to prevent this wasteful server action) That's not a "wasteful server action". Not even the server doing it. It's your browser. but if I type in domain.com/page it doesn't redirect (add the trailing /). Should it? If you want it to. If I can ensure htaccess just redirects everyone to https://www.domain.com/page/ then I think that may be it. How would I do this? RewriteEngine on RewriteCond %{HTTPS} off RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L] Link to comment https://forums.phpfreaks.com/topic/262648-domaincom-to-go-to-httpswwwdomaincom/#findComment-1346184 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.