We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36926
    • 701 Posts
    Hi,

    Is it possible to change the site_url in EVO. I basically want to make it output the WWW. Currently it outputs:
    http://mydomain.com

    But ideally I want to output
    http://www.mydomain.com

    The reason for this I’m using the sitemap snippet, but want all my links within the xml to include the www so I don’t get multiple variations of the pages indexed.

    Thanks

    Ben
      • 22303 MODX Staff
      • 10,725 Posts
      The default .htaccess has rules you can uncomment to force all requests to the www version of the site.
        • 36926
        • 701 Posts
        Quote from: OpenGeek at May 28, 2010, 09:21 AM

        The default .htaccess has rules you can uncomment to force all requests to the www version of the site.

        Hi OpenGeek, thanks for the reply. I’ve actually got my .htaccess rule to force all requests to the www, but should I be listing a url in my site map that actually going to get a 301 redirect?

        Site map has:
        <url>
        <loc>http://domain.com/page.html</loc>
        <lastmod>2010-05-28</lastmod>
        </url>
        

        But will then be redirect to the www.domain.com version.

        Just seems like bad practice to have the wrong URL in the sitemap, even if it redirects.

        I’ve actually over come this by manually changing the line in the site map URL, but thought there maybe a better way to do this.
        $url = 'http://www.mydomain.com/[~'.$doc['id'].'~]';
        
          • 22303 MODX Staff
          • 10,725 Posts
          If you have <base href="[(site_url)]" /> in your HEAD this should not be a problem; or you should use a sitemap tool that includes [(site_url)] in front of the relative links it is apparently generating.