Changing hosting provider #4

It has been three days ago since I switched my site to the new server. Little by little the visitors switched as DNS servers synchronised all over the world. And little by little I noticed some problems on my site.

These problems were related the two changes I made in the set-up of my site: I moved my photo gallery from its subdirectory /photos to its own sub-domain photos.braintags.com and I changed all URLs of the individual archives from entry_name.html to entry_name/index.shtml.

The first change broke all links to the photos --- and what is a photo gallery without photos? --- which I corrected by editing all 51 entries. Furthermore I still have to create a symbolic link to some files from my main site, like robots.txt.

The second change broke nothing on my site, but some links to my pages on other sites (Google!) broke terribly. Therefore I decided to us my good friend mod_rewrite to serve people the right page. All I had to do was to create a rule to redirect requests for /archives/yyyy/mm/entry_name.html to /archives/yyyy/mm/entry_name/. So I created the following rule:

# Redirect old URI's to future-proof directories
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (archives/[0-9]{4}/[0-9]{2}/.*)\.html$ $1/ [R=permanent]

This did a good job, except for two problems: it also redirected the URI of my monthly archives to archives/yyyy/mm/index/ and it added a slash in front of the URI, so the URL would look like http://jeroensangers.com//archives/.... The first problem was easily solved:

# Redirect old URI's to future-proof directories
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !index.s?html$
RewriteRule (archives/[0-9]{4}/[0-9]{2}/.*)\.html$ $1/ [R=permanent]

For the second problem I am still looking for a solution.

Leave a comment

Monthly Archives

Recent Entries

  • Comments and tweets

    A recent trend in the blogosphere has been to add **tweets as comments** on posts. I understand where this comes from, as in general...

  • Manifiesto «En defensa de los derechos fundamentales en internet»

    Ante la inclusión en el Anteproyecto de Ley de Economía sostenible de modificaciones legislativas que afectan al libre ejercicio de las libertades de expresión, información...

  • Commenting not possible

    I just discovered that it currently is not possible to comment on this blog. At first sight it looks like the problem is caused...

  • Back from the CeBIT

    I am back from the CeBIT show. Actually, I came back on Monday, but have been too busy to post. This year has been...

  • Downloading viruses?

    I just saw the screen above, which is the ClamWin antivirus software uploading its virus database. On the left hand side they have an animation...

Close