October 24

0 comments

Redirecting a folder using Apache redirects

By Christopher Mendla

October 24, 2011


Last Updated on December 2, 2019 by Christopher G Mendla

We are in the process of converting a number of our MS Frontpage bases sites to Joomla based sites.

Most of the FP sites had pages with HTM extensions. We turned on most of the SEO functions for Joomla 1.7. The resulting URLs have an HTML extension. Over the years, search engines have indexed the pages. If we simply switch form Frontpage to Joomla, there will be a period of time when the URL in the search engines leads to a page not found error.

One way to deal with this is with 301 redirects. You can edit your.htaccess file and set up redirects. For example,

Redirect 301 /about_wildwood.htm http://wildwoodviews.com/about-wildwood.html

That will work. However, we had a series of pages for various hotels in  the three communities. Doing a 301 redirect for each page can be tedious.

We found that the RedirectMatch command will work in our case. e.g.

RedirectMatch 301 ^/Motels/Wildwood/ http://wildwoodviews.com/accommodations/wildwood.html

That  will take all of the pages that were found under /Motels/Wildwood on the old server and redirect them to the general wildwood page. Keep in mind that this redirect is taking traffic intended for a specific page and dumping it to the general page for that area. For our purposes, with this site, that will work.

Caveats:

  1. SEO is a complex field, there is no guarantee that this method will not harm your rankings
  2. Using redirects can result in an infine loop locking your site.  ONE error can crash your site. Usually though, fixing the error restore  the site to visibility.

Christopher Mendla

About the author

Leave a Reply

Your email address will not be published. Required fields are marked

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}