How to set up a 301 redirect using htaccess you ask?

How to set up a 301 redirect using htaccess you ask? Better yet, why would one do such a thing? Both are questions I was asking myself late last week. See, Google et al treat theblogstudio. com and www. theblogstudio. com as separate sites. Technically, www is a subdomain, similar to this. that. com, where that. com is the domain, and this is the subdomain. In other words, www. theblogstudio. com and theblogstudio. com might be stealing page rank and search juice from each other. This will not do! This is where the 301 redirect comes in. A redirect simply tells any browser that’s looking for theblogstudio. com to automatically go to www. theblogstudio. com. Setting up is pretty simple, if you’re comfortable editing files on a server. Assuming you know your way around an ftp program (I use Transmit, for the mac), point your self at your hosting account. Look in the root or public_html folders (setup may be different, according to your host) and try to find a file called. htaccess Note the. before the name. This means that it’s a hidden file. You may have to look for “Show Hidden Files” in your ftp program. Try looking in Preferences or under the View menu. Not all blog programs require. htaccess, and not all hosting plans allow it’s use. So you may be out of luck using this technique. Not to fear though! Webconfs. com lists 7 different ways to create a 301 redirect. Assuming you’ve found the. htaccess file, make a copy of it somewhere for backup. Next, open the file in a text editor. The following is from webconfs. com/how-to-redirect-a-webpage. php (reposted here with permission). Redirect to www (htaccess redirect) Create a. htaccess file with the below code, it will ensure that all requests coming in to domain. com will get redirected to Options +FollowSymlinksRewriteEngine onrewritecond %{ rewriterule ^(.*)$ Please REPLACE domain. com and Note* This. htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled. You can stick this at the end of your existing. htaccess file. Now replace the version on the server with your modified file (you did make a backup of the original file, right?). Test it out. You can use a 301 redirect for a variety of things, including moving domains (just point your old URL to the new site), directing search engines when you move a file, and more. Creating a 301 redirect is a gentle way to enter the dark world of. htaccess. With a little knowledge, and a good command of copy and paste, you can customize your. htaccess file to do some very useful things. For a great list of stupid htaccess tricks, check out Perishable Press

Карта сайта

Информационный сайт