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

    I'm trying to permanently 301 redirect an old page to a newer version with the following in my .htaccess:

    Redirect 301 /web-design.html http://www.mydomain-name.co.uk/new-web-design.html

    which at first I thought was working but it's also redirecting:

    /anotherpage-web-design.html to http://www.mydomain-name.co.uk/new-web-design.html

    If anyone can post the correct markup I'd be thankful!?
      • 30912
      • 463 Posts
      RewriteRule ^web-design.html$ http://www.domainname.com/new-web-design.html [R=301,L]

      Thats what i use smiley
        • 4565
        • 5 Posts
        Quote from: Tyreal2012 at Mar 13, 2014, 08:49 AM
        RewriteRule ^web-design.html$ http://www.domainname.com/new-web-design.html [R=301,L]

        Thats what i use smiley

        Perfect! works like a charm! thanks ;-)
          • 9995
          • 1,613 Posts
          Is this SEO proof?

          I would like to have my homepage not as www.sitename.com but always like www.sitename.com/rotterdam-development.html

          At the moment google says, hey thats duplicate content!
          or should I better use a canonical link?
          Did anyone used that already?
            Evolution user, I like the back-end speed and simplicity smiley
            • 9995
            • 1,613 Posts
            Would this do it when I set this on the homepage?

            <link rel="canonical" href="http://www.sitename.com/rotterdam-development.html">

            <link rel="canonical" href="[(site_url)][~1~]">
              Evolution user, I like the back-end speed and simplicity smiley
              • 30912
              • 463 Posts
              Hiya,

              Not sure tbh, i use that solely for rewriting urls from one to another

              ive never had the homepage as anything other than www.sitename.com
                • 9995
                • 1,613 Posts
                when you add an alias to your homepage like home or whatever then: site.com/ is the same page as site.com/home
                google see it as duplicate content as what I think is whats happening.

                but actually this is a other subject. your 301 redirect works. lipsrsealed
                  Evolution user, I like the back-end speed and simplicity smiley
                  • 2762
                  • 1,198 Posts
                  @fourroses666

                  1) www.sitename.com it would be better for seo
                  2) but if you prefer sitename.com/rotterdam-development.html - yes, canonical url will solve google webmaster tool duplicate content


                  @canman
                  Try Virtual Alias or NGRedirect plugin instead .htacess redirect

                  http://www.stanback.net/code/modx/virtual-aliases.html

                  http://modx.com/extras/package/ngredirect
                    Free MODx Graphic resources and Templates www.tattoocms.it
                    -----------------------------------------------------

                    MODx IT  www.modx.it
                    -----------------------------------------------------

                    bubuna.com - Web & Multimedia Design
                    • 13226
                    • 953 Posts
                    Quote from: fourroses666 at Mar 21, 2014, 09:25 AM
                    Would this do it when I set this on the homepage?

                    <link rel="canonical" href="http://www.sitename.com/rotterdam-development.html">

                    <link rel="canonical" href="[(site_url)][~1~]">

                    You may or may not be aware of this but you can set the "Site start" in the system configuration.

                    Quote: "Enter the ID of the Resource you want to use as homepage here. NOTE: make sure this ID you enter belongs to an existing Resource, and that it has been published!"

                    I haven't tried this but give it a go

                    If it doesn't fully work, then use a combination of canonical and site start

                    My canonical call:

                    <link rel="canonical" href="[[if? &is=`[*id*]:is:1` &then=`[(site_url)]` &else=`[(site_url)][~[*id*]~]`]]">
                      • 9995
                      • 1,613 Posts
                      @banzai, Why would with-out be better? I think adding an url to the home will be better for seo, but maybe it doesn't matter that much. The only thing I don't like about it is that it doesn't look that nice.

                      @iusemodx, I know about the site start offcourse, but when linking in a resourse to the homepage the "full" url pops up. So if I'm right you always need to add the canonical link to correct this for Google (duplicate content). I think your call is correct, thanks!
                        Evolution user, I like the back-end speed and simplicity smiley