mod_rewrite is my friend

28 Dec

Picture the scenario: your  website, cultivated over a decade, with deep links from the dawn of internet time, has just moved to something like… wordpress.

All those deep links, from people you can’t find anymore, to your site just broke.

This is the time to reach for the magic that is mod_rewrite.

You may already have some of these lines. Add the other ones in context.

To the .htaccess file at the top of the website, add:

RewriteEngine on
RewriteBase /
RedirectMatch 301 ^/ancient_url.html http://your_website_address/new_relevant_page/

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: