We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8168
    • 1,118 Posts
    Hi guys, is it possible to get a 301 re-direct to work in the .htaccess file WITH the SEO Friendly URLS switched ON in REVO?

    Not had any luck to date... can't see to find a working solution from anyone....?

    Any ideas???

    Thanks!
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Can't you just add R=301 to the rewrite rule?
      RewriteRule ^(.*)$ index.php?q=$1 [R=301,L,QSA]
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 10208 ☆ A M B ☆
        • 1,780 Posts
        Why bother with .htaccess? The Redirector Extra is mighty handy and works well for the purpose.
        http://rtfm.modx.com/display/ADDON/Redirector

        It does take a little time setting it up, especially if you've got a lot of urls to redirect. I wouldn't want to enter a thousand url's into it one by one.

        Susan, how does this rewrite rule work? Redirect to index.php or would it redirect to the correct page?
        	
        RewriteRule ^(.*)$ index.php?q=$1 [R=301,L,QSA]
          Frogabog- MODX Websites in Portland Oregon
          "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
          Having server issues? These guys have MODX Hosting perfected - SkyToaster
          • 8168
          • 1,118 Posts
          Hi Susan,

          The catch all redirect is working as per the friendly SEO settings.

          What I am looking to do AS WELL as using the default SEO friendly urls on is add in some bespoke rules for old urls... E.g.

          Redirecting /contactus.html to /contact.html

          I want to add in these ad hoc 301 rules to the .htaccess page to enable this but when I try it doesn't work... The redirect takes one to the designated error page as per the settings in modx dashboard...

          How can I overwrite it in these special circumstances?
            • 8168
            • 1,118 Posts
            Thanks Frogabog - I will have a look at that plugin - must surely be a way to get it working in the .htaccess file using the standard MODX SEO Friendly URLs settings though??? Surely I am not the first person to try this?

            As I am unable to test right now - does http://rtfm.modx.com/display/ADDON/Redirector work with SEO URLS on in the core MODx settings? [ed. note: dubbs last edited this post 13 years, 10 months ago.]
              • 8168
              • 1,118 Posts
              Quote from: sottwell at Dec 06, 2012, 12:05 PM
              Can't you just add R=301 to the rewrite rule?
              RewriteRule ^(.*)$ index.php?q=$1 [R=301,L,QSA]

              Susan, What does adding in that line do? Seems to be very similar to the line already in the default .htaccess file for SEO friendly urls re-direct?

              What I need to add in and enable to get working is

              RewriteRule ^old.html$ http://www.site.com/new.html [L,NC,R=301]
                • 10208 ☆ A M B ☆
                • 1,780 Posts
                Quote from: dubbs at Dec 06, 2012, 01:14 PM

                As I am unable to test right now - does http://rtfm.modx.com/display/ADDON/Redirector work with SEO URLS on in the core MODx settings?

                Seems to work fine. I assume you mean Friendly URL's? I'm not aware of a SEO URL's setting.

                The plugin allows you to manually enter a url, and then select and ID from the MODX resources to redirect to.

                I noticed recently in analytics that most of the direct link visitors have been using the old static file urls for the index page.
                  Frogabog- MODX Websites in Portland Oregon
                  "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                  Having server issues? These guys have MODX Hosting perfected - SkyToaster
                  • 8168
                  • 1,118 Posts
                  Quote from: frogabog at Dec 06, 2012, 06:19 PM
                  Quote from: dubbs at Dec 06, 2012, 01:14 PM

                  As I am unable to test right now - does http://rtfm.modx.com/display/ADDON/Redirector work with SEO URLS on in the core MODx settings?

                  Seems to work fine. I assume you mean Friendly URL's? I'm not aware of a SEO URL's setting.

                  The plugin allows you to manually enter a url, and then select and ID from the MODX resources to redirect to.

                  I noticed recently in analytics that most of the direct link visitors have been using the old static file urls for the index page.

                  Thanks - I will give that a try then... Cheers