How and where to define BASE_URL in 5.7
Permalink
What's the best way to ensure that my base url includes www?
Does anybody have any idea how to get all links to be relative like the old 5.6 version? It was one of the features I loved about C5, I didn't have to go through the db file and replace all the urls when going live. I've found that setting the canonical url to the relative url works for page links but ajax requests in the dashboard like sitemap attributes menus are not using the relative (canonical) url
Whoops nevermind it still works like it used to you just set DIR_REL like you used to, put it in one of your configs:
define('BASE_URL', 'http://localhost');
define('DIR_REL', '/mydirrel');
define('BASE_URL', 'http://localhost');
define('DIR_REL', '/mydirrel');
Which 'config' exactly?
I just add this to my .htaccess file:
Of course you need to replace the 'yourdomain.com' part with your own domain name.
RewriteCond %{HTTP_HOST} ^yourdomain.com [NC] RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]
Of course you need to replace the 'yourdomain.com' part with your own domain name.
Can you explain this using the following example? I built the site here, under the following domain and subdirectoryhttp://www.allinstorage.com/mlorch... and the final live site is here, athttp://www.azstorage.com. I need all of the allinstorage.com/mlorch traffic to redirect to the live/permanent site at azstorage.com.
That's the way I've always done it in 5.6, but not working for me in 5.7 anymore.
For 5.7:
In the URL settings in the dashboard you can set the canonical URL to include the www, and then check the box for only using canonical URLs and save your changes. The site will then always redirect to the www before your site.
In the URL settings in the dashboard you can set the canonical URL to include the www, and then check the box for only using canonical URLs and save your changes. The site will then always redirect to the www before your site.
I have a rather large site in development and I want to make sure I don't need to change all the links within 'content' blocks when it goes live. Will setting base_url solve this? Or is there a way to have links within content block always be relative?