Tagged: url Toggle Comment Threads | Keyboard Shortcuts

  • Peter Mahoney 12:00 pm on July 17, 2013
    Tags: 301, , domain, , move address, redirect, url   

    Permanently moving website to a new domain 

    You really want to add this to your .htaccess file:

    Redirect 301 / http://your-new-domain

    Let’s break that down.

    • “Redirect” is pretty obvious, it tells the web server to redirect the request.
    • “301” is a special code that tells any search engines that come by that this change is permanent, and they should update their results to reflect the new URL. (Using “302” instead would set it as a temporary move.)
    • “/” just means the entire site, from the very top directory has been moved.
    • http://your-new-domain” or indeed, whatever your new URL is, is the new domain that all requests should be sent to. Note the final “/” on the end.

    Easy peasy! Now all bookmarks, and search engine results will still be valid and get people to your new address, with one short piece of code.

    Permalink | Reply
  • Peter Mahoney 2:42 pm on February 19, 2013
    Tags: hashtagnerdy, hastags, linking to twitter with hashtags, , url   

    Make a “Share on Twitter” link with URL and Hashtags 

    This is a little coding trick I get asked about quite a bit.

    The link you have to make to share something to Twitter is quite simple:

    http://twitter.com/share?text=text goes here

    But getting a URL and hastag in there is a different matter. To be honest most developers do know how to include the URL, but hashtags have proved more elusive!

    http://twitter.com/share?text=text goes here&url=http://url goes here&hashtags=hashtag1,hashtag2,hashtag3

    Here’s an example to try out:

    http://twitter.com/share?text=Here's an awesome tip!&url=http://petermahoney.net/make-a-share-on-twitter-link-with-url-and-hashtags/&hashtags=peter,is,awesome

    And that’s it!

    Permalink | Reply
compose new post
next post/next comment
previous post/previous comment
show/hide comments
go to top
go to login
show/hide help
shift + esc