wordpress url redirect

by 6 replies
7
My old site was mydomain.com/content.html now i moved my site to wordpress andthe url is mydomain.com/content/

So now how can i redirect all of my inner pages to the news ones.

What is the effect in the google.
#programming #redirect #url #wordpress
  • You can set a 301 redirect to engage your visitors to the new location. A little htaccess editing will do the job.
    • [1] reply
    • If your server is running Apache, you just need to add something like this to your .htaccess file:

      redirect 301 /content.html /content/
      redirect permanent /content.html /content/


      Or something similar, and the paths are dependent on where you have the .htaccess file placed. Plus, I'm a bit rusty -- but that's the basic code. Basically, it's setup like this:

      Command [space] /oldfile/ [space] /newfile/

      You may need to use the full URL in the 'newfile' part ( I can't remember), and if your blog is keeping the same page name as your site did, you may be able to use a Regular Expression to use a few lines of code versus creating individual redirects for each page.

      As far as Google is concerned, as long as you're using a 301 redirect, when Google visits the old page (after adding the redirect) your server will let Google know the page has moved and Google will eventually update it in their index. I've changed permalink structures & moved a blog from one domain to another at the same time without much consequence, and I even temporarily ranked (on my new site) for keywords that we relevant to the old domain but didn't show up at all on the new site. So, there was some link value and 'anchor text weight' passed to the new domain with a redirect, but I've always assumed you lose some of the Page Rank value when using 301 redirects.
  • Use 301 redirection in your .htaccess file. When Google will Crawl the old address it knows that page has moved to new address with 301 redirect. Then the New Address will get indexed in the Google.
  • ok but when i change the .htaccess file it give me 500 internal server problem and no of the website works then..
    • [1] reply
    • Hi Jacob,

      If your willing to provide FTP or Screenshare access I can either set this up so it works for you or show you how to do it for future reference?

      The HTTP Error 500 is due to an error in your .htaccess code.

      Kind Regards,
      Stuart Macfarlane
      • [ 1 ] Thanks
  • I have a plugin called SS Old URLs in the WordPress repository that helps with this sort of thing. It will do the 301 redirect through WP... or if you think it needs to be done as fast as possible, it gives you the correct 301 code to add to your .htaccess.

    WordPress › SS Old URLs « WordPress Plugins

    If you need to clean up your .htaccess, try removing what you added. If you still get the 500, delete your .htaccess and have WP rebuild it by going to Settings --> Permalinks in the admin. (make a backup just in case you had other stuff in the .htacccess)

Next Topics on Trending Feed

  • 7

    My old site was mydomain.com/content.html now i moved my site to wordpress andthe url is mydomain.com/content/ So now how can i redirect all of my inner pages to the news ones.