ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

a question of urls

November 20, 2011 1:54pm

Subscribe [4]
  • #1 / Nov 20, 2011 1:54pm

    bthom62

    164 posts

    How do you force the website to show only the proper url instead of an url full of junk?

    example (name withheld to protect the stoopiidd….)

    whatever.com/index.php/article/42528#.Tsk00HUElxU.gmail

    will show the article, when it should be forced to only show:

    whatever.com/index.php/article/42528


    any ideas?

    at the same time the website shows up as http://www.whatever.com  and whatever.com

    using htaccess how do we stop that?

    thank you

  • #2 / Nov 20, 2011 8:06pm

    Where are you getting that first link? Is it on your site or in an email?

    As for the second, you can do something like the following to route everything to www, make this the first thing in your htaccess.

    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
    RewriteRule ^(.*)$ <a href="http://www.domain.com/$1">http://www.domain.com/$1</a> [R=301,L]
  • #3 / Nov 20, 2011 9:00pm

    bthom62

    164 posts

    not generated from our site, but from an external email.

  • #4 / Nov 21, 2011 3:38pm

    Dan Decker

    7338 posts

    Hi bthom62,

    Did caddisint’s .htaccess directive work for you? As to your first question, what do you want to happen when the URL:

    whatever.com/index.php/article/42528#.Tsk00HUElxU.gmail

    Is visited at your site? Would like it to generate a 404? Obviously, how the URLs are formed in outside sources are out of your control, but we can change the way ExpressionEngine deals with them when it intercepts them. Have you enabled strict URLs on this site? Design-> Templates-> Global Preferences: Enable Strict URLs and note the way it interacts with the “404 Page” setting in the same pane.

  • #5 / Nov 21, 2011 5:05pm

    bthom62

    164 posts

    Thank you Dan

    The HT access worked well

    Thank you

    I am worried that google might penalize me forhave multiple versions of the story

    re:  whatever.com/index.php/article/42528#.Tsk00HUElxU.gmail

    I would like that no matter what garbage showed up after:

    whatever.com/index.php/article/42528

    that it would all devolve to:

    whatever.com/index.php/article/42528

    Does that make sense

     

  • #6 / Nov 22, 2011 7:35pm

    Sean C. Smith

    3818 posts

    bthom62,

    The reason that URL is working is that the “junk” part starts with a hash “#” and this is part of the name attribute for anchor tags. As such this means your browser has found the correct page and would auto scroll to the correct on the page if it only existed.

    Sean

  • #7 / Nov 22, 2011 10:02pm

    bthom62

    164 posts

    thank you

    Thing is it doesn’t

    I am a little worried when I go to webmaster tools and see reams of pages with weird urls

  • #8 / Nov 23, 2011 2:55pm

    Dan Decker

    7338 posts

    Hi bthom62,

    In theory, you could have mod_rewrite strip out everything starting at the hash, but that would be inadvisable since it would also break legitimate use of the hash as well. Are you analytics tool indicating that you are getting dinged for multiple URLs? Have you looked on google to see where these links might be coming from?

    Since this has moved beyond the scope of ExpressionEngine technical support, I’m going to move this into Community Help to keep the discussion going.

    Thanks!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases