If you are integrating WordPress into a preexisting site that already has its own homepage, or if you are developing a new WordPress website that is hidden behind a Coming Soon page, you will run into one frustrating problem. If you try to access the WordPress installation by visiting the index.php file, you won’t be able to see it. Instead, WordPress will automatically redirect you from the index.php page to the blog address url, as defined in your WordPress site settings.
There are, of course, several ways to get around this problem. Two common ways include:
Unfortunately, these methods can result in quite a bit of extra work. Fortunately, it is easy to stop WordPress’ automatic redirects. But first, it is a good idea to know why WordPress employs these redirects.
A page on any website, WordPress or not, can be accessed by multiple urls. For example, you can typically visit the home page of a WordPress web site by all of the following urls:
The problem with allowing all of these ways to access a single page is that it can potentially hurt your website’s overall search engine optimization (SEO). Having multiple urls for a page means that search engines could index duplicate copies. So WordPress fixes this problem by employing automatic redirects known as Canonical URL Redirection, which only enables one url per page.
To turn off Canonical URL Redirection, you can add the following code to your theme’s functions.php file.
remove_filter('template_redirect','redirect_canonical');
Not comfortable altering your theme files? WP developer Mark Jaquith has placed this code in his Disable Canonical URL Redirection plugin.
To learn more about the introduction of Canonical URLs, see Migrating Plugins and Themes to 2.3 in the WordPress Codex.
Tags: redirects, search engine submission, urls, WordPressTrackback URL for this entry:
http://www.velvetblues.com/web-development-blog/turn-off-wordpress-homepage-url-redirection/trackback/
Contact us today for a quote. Click here to submit details regarding your project.
If you are making a general inquiry, send an email to info@velvetblues.com
I hadn’t looked into it but i was wondering if this can be done at all. Although you have to be very careful when doing it since duplicate content is not generally a good idea. Nice to see you back
stratosg’s last blog post..Member Of The Month: April
I still prefer Index.html method to be the best and handy
Harsh Agrawal’s last blog post..Why I love Thesis wordpress premium theme
Hey welcome back. Where have you been?
Thanks for this little tip on WP URL redirection
Ajith’s last blog post..Blog Scraping – How to deal with it?
Thank you… Didn’t even know there was a plugin yet… Love the idea of not needing to alter existing php
I agree, I don’t like altering .php files. I have done it but I’m never quite sure I’m not screwing something up in the process. Come to think of it, it caused me to delete and reload themes a few times. Thanks for the tip on the plugin. It will come in handy.
Steve @ Find Retro Shower Curtain´s last blog ..Dofollow, Top Commentators (Commenters), CommentLuv, KeywordLuv
Anyone home?

Dennis Edell´s last blog ..What I’m Doing – What You Should Expect In The Very Near Future.
hi frien. how do you think about the pretty link. Its a redirection used to create redirection. are you think it will droped our web from search engine?
Thank you for this. One Google search and I got my answer!
You can also use the All-In-One SEO plug-in which turns this function without editing the PHP yourself. I’m a big supporter, fan and friend of Mark Jaquith’s work, but this plug-in provides a lot more features as well if you’re going to install a plug-in.
Bnpositive´s last blog ..I’m No Expert
I guess I prefer the ‘extra work’ method. I use a sub-domain and match the headers to function site wide. Turning off the canonical URL redirection seems dangerous but I can see why some would go that route.
Brian D. Hawkins´s last blog ..20 Expired Domains Coming Available
I know I sound like a numpty but were do I put the plugin file?! I’ve downloaded ‘disable-canonical-redirects.php’ but don’t know were to upload it now?
One main reason to turn this off in WP is for a very simple fact… and it relates to SEO; and take it from me, I have a been a full-time web developer for 12 years. The way WP wrote the redirect is bad. If you submit your site to Google, or it just finds it as http://www.yourdomain.com, and the WP redirect is set to yourdomain.com – Google will see a 301 message for www, but instead of following it, the bot will stop dead. So the bot never actually indexes any of your content! Yahoo.com bot does the same. So, you can either worry about the negligible issue of having duplicate content indexed, or settle with no content index at all… I choose multiple content.
Very useful tutorial and I didn’t know that wordpress has a automatic redirection system. It could also cause the duplicate content issue within a site.
Career Outlook´s last blog ..Mechanical Engineer Career Outlook