We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32017
    • 151 Posts
    i have friendly urls

    and google have indexed this

    my domain .co.uk/?referrer=cssbased.com

    i want /?referrer=cssbased.com

    to return an error so google wont index it,

    any ideas?
      London web design - MODx specialists
      • 5727
      • 160 Posts
      I thought you guys were SEO certified specialists? wink

      Possible options:
      - Use robots.txt
      - Use meta tags
      - Use some kind of scripts to block spiders (google: block search bots)
      - Use google web master tools to take control (https://www.google.com/webmasters/tools/)
        Olivier Deland
        Montreal, Canada - Web Developer
        • 32017
        • 151 Posts
        LOL i know , its very ironic ! we have tried robots and everything thats why im thinking it to do with how modx uses the friendly urls and how it handles ?

        if you goto the site in question http://www.hostpixel.co.uk  and then type /bsdbsuds  we have redirected the error page back home but if you type

        ?=xxxx or what ever it doesnt treat it as an error !

        :)

        We have tried the google webmaster tools we are on it everyday managing dozzens of sites. but the request to remove that url doesnt work as its not reconised ! this is defo a modx parsing problem allowing these sort of urls
          London web design - MODx specialists
          • 32017
          • 151 Posts
          I dont have this that page to add the rel too ! the referer url is added by the website cssbased automatically they are linking to my site using it ...
            London web design - MODx specialists
            • 32017
            • 151 Posts
            I need to make the friendly urls give an error for every url with a ? in it !

            mydomain.com/? doesnt give an error but mydomain.com/X does
              London web design - MODx specialists
            • Do what? So in other words, you want to strip all query strings from public requests to your site? You’ll have to write a plugin to redirect such requests without the query string, or modify the mod_rewrite rules to ignore all query string parameters (removing the QSA will prevent rewritten URLs from appending the query string sent in the request). But that will break any component that depends on $_GET parameters...
                • 32017
                • 151 Posts
                i use friendly urls so all my urls are like mysite.com/aboutus mysite.com/contact urls like mysite.com/iuifeo obviously work and return the error page which is all good. BUT if you go to mydomain.com/? or mydomain.com/?andthinghere it just stays in the home page and doesn’t goto the error page....

                What can you suggest to get pretty much every url starting /? redirect to the error document !

                Understand?

                Thanks.
                  London web design - MODx specialists
                  • 33372
                  • 1,611 Posts
                  That’s a very odd request, but you could certainly do it in .htaccess if you really want to (read up on .htaccess rewiting here or Google it for tons of info).
                    "Things are not what they appear to be; nor are they otherwise." - Buddha

                    "Well, gee, Buddha - that wasn't very helpful..." - ZAP

                    Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
                    • 32017
                    • 151 Posts
                    ive tried 301 redirects and re write rules in httacess thats the first thing i tried but none worked !  as i said this place is the last resort lol  why does modx allow /? and not /test in friendly urls !

                    if you must know why i need this, goto google and search for hostpixel then you will see my problem !
                      London web design - MODx specialists
                      • 33372
                      • 1,611 Posts
                      I’m not sure what you mean about MODx allowing /? and not /test in friendly urls... People using friendly URLs often still need to pass variables in the $_GET array (in the URL query string), so completely eliminating question marks would break a lot of common scripts. And it certainly allows the latter URL (/test), assuming you have a page with the alias "test".

                      So anyway it seems like a bad idea to me to try to forward all pages with question marks in the URL to an error page, but you can do it if you really want to (although why not make your rule more specific to the link you want to change so as not to break everything?). Just make sure that your rewrite rule is before the default MODx one, and that it’s the last rule executed (and of course that you’re matching the query string, not the URL itself). Check your syntax, because it sounds to me as if this should work in .htaccess if you do it properly.

                      Although you probably should just add this to your robots.txt file, no? That way search engines won’t index it, but it will still work as a page if people click on it. I wouldn’t think you’d want this link to just stop working for actual visitors, would you?

                        "Things are not what they appear to be; nor are they otherwise." - Buddha

                        "Well, gee, Buddha - that wasn't very helpful..." - ZAP

                        Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options