We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3071
    • 99 Posts
    I am not quite a developer but understand a little! I am having big problems with the friendly URLS on MODX, they simply will not work - version 0963. The server is Apache on Linux and I used to use Wordpress and the friendly URLs worked fine, just that the CMS is limited. I have tried everything and many variations in the .htaccess file, nothing. I called Fasthosts and they said that it is enabled and this is consistent with it working fine on Wordpress. I also tried this bit of script with two static pages I have in my root directory and it worked fine:

    RewriteEngine on
    RewriteRule ^old\.html$ new.html

    i.e www.mysite.com/old.html redirected to www.mysite.com/new.html

    I also tried adding some random characters to the .htaccess file to see if the server was reading this file, and sure enough I got an error so believe that it is. I am by no means an expert but feel I have tried everything in my power up to now!! This is quite frustrating as the CMS is top notch, but I really need this feature! Thanks in advance for any help or suggestions.
      • 26931
      • 2,314 Posts
      Hi benchesters,

      maybe this article helps -> http://wiki.modxcms.com/index.php/Friendly_URLs_Guide

      did you rename your file to .htaccess (it’s named ht.access on a fresh install)

      is your installation in a subdirectory (e.g. your-directory), adapt this part in your .htaccess:

      #Options +FollowSymlinks
      RewriteEngine On
      RewriteBase /your-directory

      j
        • 3071
        • 99 Posts
        Hey, thanks for the speedy response...Now, I have just discovered something. I never manually checked the URL... I just used the page preview button and it kept the PHP+ etc one. Just checked manually and it does work! BUT....Does this mean I will have 2 pages served with the same content? For example:

        This is the URL it lets me preview:

        http://www.whostolethesoul.co.uk/index.php?id=3

        This is the one that I wanted, so typed it in manually:

        http://www.whostolethesoul.co.uk/this-is-the-alias-test

        Now which one will Google see/index? Also, why in the preview does it not just serve up the tidy URL. or is this just standard? Thanks for any help.
          • 26931
          • 2,314 Posts
          glad it works now smiley

          here’s a handy plugin for seo-strict urls -> http://modxcms.com/extras/package/?package=395

          and change your .htaccess that all requests will either direct to http://www.yourdomain.com (which i prefer, and i think google also suggests), or to http://yourdomain.com:

          uncomment one of these parts in your .htaccess:
          # Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
          #RewriteCond %{HTTP_HOST} .
          #RewriteCond %{HTTP_HOST} !^example-domain-please-change\.com [NC]
          #RewriteRule (.*) http://example-domain-please-change.com/$1 [R=301,L]
          #
          # or for the opposite domain.com -> www.domain.com use the following
          # >>> DO NOT USE BOTH THE ABOVE AND BELOW <<<
          #
          #RewriteCond %{HTTP_HOST} .
          #RewriteCond %{HTTP_HOST} !^www\.example-domain-please-change\.com [NC]
          #RewriteRule (.*) http://www.example-domain-please-change.com/$1 [R=301,L]


          j
            • 3071
            • 99 Posts
            Thanks, it seems to work but I am just concerned about indexing and wondering wether the php suffix URL is on a 301 redirect to the clean URL. I also just ran a site crawler and it’s not picking up the pages I have published for any of the URL variations. Wondering why this is? Once I know that the pages are being picked up by the search engines and indexed properly then I’ll be a happy man! If anyone knows anything about this then I’d be grateful. Thanks
              • 26931
              • 2,314 Posts
              Thanks, it seems to work
              did you install the plugin, or do you mean the new .htaccess-rule?

              here’s a quote from the plugin description:
              In certain cases, search engine algorithms will penalize websites for displaying identical content among multiple pages. With friendly URLs (FURLs) turned on and a FURL suffix defined, the same document can potentially be referenced using 8 separate URLs:

              http://yoursite.com/doc_id
              http://yoursite.com/doc_id/
              http://yoursite.com/doc_id.suffix
              http://yoursite.com/doc_id.suffix/
              http://yoursite.com/alias
              http://yoursite.com/alias/
              http://yoursite.com/alias.suffix
              http://yoursite.com/alias.suffix/

              This plugin uses 301 redirects to forward users and search engines alike to a single URL based on plugin and FURL configuration. In addition to redirecting, the plugin can also (optionally) rewrite document links/URIs.

              was that your problem/question?

              cheers, j
                • 3071
                • 99 Posts
                Well I haven’t installed the plug in as yet as the URLs are fine so I can’t see the benefit of the plug in? I just used the .htaccess file?
                  • 3071
                  • 99 Posts
                  Also I don’t think this plug in will work as I am using a newer version of Modx. My current .htdocs file is as follows, I followed a tutorial and changed it accordingly so that my URL is in there. I can’t be sure whether it would have worked using the wiki guide as I never tried to manually type the clean URLs in, despite spending all day on it! Just happy now that they seem to work..The rendered source code validates 100% as well at WC3 validator so I imagine it is more than crawable, still, need to work out which URL Google picks, if any.

                  RewriteEngine On
                  RewriteBase /

                  RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
                  RewriteRule .* - [F,L]

                  RewriteCond %{HTTP_HOST} .
                  RewriteCond %{HTTP_HOST} !^www\.whostolethesoul\.co.uk [NC]
                  RewriteRule (.*) http://www.whostolethesoul.co.uk/$1 [R=301,L]

                  RewriteCond %{REQUEST_FILENAME} !-f
                  RewriteCond %{REQUEST_FILENAME} !-d
                  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
                    • 26931
                    • 2,314 Posts
                    i’m sure the plugin will work with the current release, but i’ll check that later

                    i also suggest to register for Googles Webmaster-Tools and submit a Google Sitemap, there are some snippets around for this. i use this one -> http://modxcms.com/extras/package/?package=410

                    j


                      • 26931
                      • 2,314 Posts
                      Well I haven’t installed the plug in as yet as the URLs are fine so I can’t see the benefit of the plug in?

                      ->

                      In certain cases, search engine algorithms will penalize websites for displaying identical content among multiple pages. With friendly URLs (FURLs) turned on and a FURL suffix defined, the same document can potentially be referenced using 8 separate URLs:

                      http://yoursite.com/doc_id
                      http://yoursite.com/doc_id/
                      http://yoursite.com/doc_id.suffix
                      http://yoursite.com/doc_id.suffix/
                      http://yoursite.com/alias
                      http://yoursite.com/alias/
                      http://yoursite.com/alias.suffix
                      http://yoursite.com/alias.suffix/

                      This plugin uses 301 redirects to forward users and search engines alike to a single URL based on plugin and FURL configuration. In addition to redirecting, the plugin can also (optionally) rewrite document links/URIs.

                      smiley