.htaccess tutorial for SEO 301 Redirects with RedirectMatch and mod_alias
Web Professionals use mod_rewrite to issue 301 and 302 Redirects for Search Engines. Sometimes you may not have mod_rewrite.c or you want an alternative redirect method. Using mod_alias RedirectMatch you can use REGEX in Redirect commands!
____________________________________________________________________________________
Web-Professionals verwenden mod_rewrite Frage zu 301 und 302 Weiterleitungen für Suchmaschinen. Manchmal kann man nicht haben mod_rewrite.c oder Sie wollen eine alternative Methode umleiten. Mit ‘mod_alias’ RedirectMatch können Sie die REGEX Redirect Befehle!
redirect Home to new Domain
Redirect 301 / http://www.htaccesselite.com
301 Redirect multiple files
RedirectMatch 301 /blog(.*) /$1
Redirect Entire site to single file
Note: This is a 302 (temporary)redirect because its meant to point to a temporarily offline file.
RedirectMatch 302 ^/ /temporary-offline.html
Putting it all together
301 and 302 Redirects
Redirect 301 /security/rigging-the-dreamhost-site-of-the-month-contest.html http://www.askapache.com/dreamhost/rigging-the-dreamhost-site-of-the-month-contest.html Redirect 301 /htaccess/speed-up-the-apache-web-server-with-configuration-hacks.html http://www.askapache.com/htaccess/apache-web-server-speed-configuration-hacks.html Redirect 301 /2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html http://www.askapache.com/dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html Redirect 301 /2007/phpbb/sending-post-form-data-with-php-curl.html http://www.askapache.com/htaccess/sending-post-form-data-with-php-curl.html Redirect 301 /htaccess.txt http://z.askapache.com/uploads/p/htaccess.txt Redirect 301 /2007/webmaster/php-and-ajax-shell-console.html http://www.askapache.com/tools/php-and-ajax-shell-console.html Redirect 301 /2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html http://www.askapache.com/dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html Redirect 301 /seo/tailrankcom-robot.html http://www.askapache.com/seo/tailrank-robot.html Redirect 301 /instruct-search-engines-to-come-back-to-site-after-you-finish-working-on-it.html http://www.askapache.com/htaccess/503-service-temporarily-unavailable.html Redirect 301 /htaccess/instruct-search-engines-to-come-back-to-site-after-you-finish-working-on-it.html http://www.askapache.com/htaccess/503-service-temporarily-unavailable.html Redirect 301 /webmaster/lft-traceroute-tool.html http://www.askapache.com/tools/lft-traceroute-tool.html # 302 Temporary Redirect 302 /apachesearch/ http://google.com/coop/cse?cx=002660089121042511758%3Akk7rwc2gx0i
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.


Comments
No comments yet.
Leave a comment