Moving Web Directories Cleanly
// February 13th, 2006 // Technology Bits
When working with large sites with a lot of content editors and changing departments, it is sometimes necessary to move around large sections of your sites structure. The major downfall to moving files is that when a search engine bot or user who bookmarked a sub page comes along and reuses their outdated link, they don’t find what they’re looking for.
A few potential solutions for this:
Leave the old content around for awhile.
– This leads to outdated content that is forgotten. Users get misinformation, and can’t enjoy your redesign.
Create a file in the old directory that does a JavaScript, META, or header redirect..
– This doesn’t scale well if there were many files or subdirectories.
Create a symbolic link (symlink) of the old directory to the new one.
– This can get out of hand making the filesystem difficult to manage. Additionally, it is easy to accidentally create circular links that can causes scripts to go into dangerous recursive loops down the directory structure.
Here’s a better solution.
If you are using Apache with mod_alias, simply add a RedirectMatch line like the following to your .htaccess file:
RedirectMatch permanent ^/old_url/(.*) /new_url/$1
Managing these RedirectMatch lines in your .htaccess is simple. In some cases with the power of regular expressions you can even simplify a ton of symlinks or redirects into just one RedirectMatch line. An additional benefit is the ability to specify the type of redirect. By saying permanent, you send the browser a 301 redirect meaning it should update its references. This is great for intelligent bots like the google bot.
Actually this merely scratches the surface of what you can do with RedirectMatch and other mod_alias directives.




Lifting REMOVAL REMOVALS
Moves guaranteed solution
Thessaloniki To Athens
We undertake the process of transfer-removal of household, company, office and other commercial premises, fast and reliable.
Tel: +30 2310 721172 & +30 6944844287