Making http://alecjacobson.com/blog == http://alecjacobson.com/weblog

Alec Jacobson

July 13, 2011

weblog/

At some point youtube wasn't letting me link to http://alecjacobson.com/weblog. I guess because it was too long. So I made a symbolic link on my server:
ln -s weblog blog
This worked OK, until my friend realized that when you accessed my blog through http://alecjacobson.com/blog all the links wordpress made were getting screwed up. At first when I tried to tackle this with .htaccess Apache directives, I came up with:
RewriteEngine on
RewriteBase /
RewriteRule blog/(.*) weblog/$1
But then wordpress was still constructing the urls wrong (sometimes putting weblog/blog/... instead of just weblog/... in links), so I had to have:
RewriteEngine on
RewriteBase /
RewriteRule blog/(.*) weblog/$1
RewriteRule weblog/blog/(.*) weblog/$1
But then this is annoying, although the page works, you could have every page with weblog/blog/... instead of just weblog/... It's kind of ugly. So, I found this very simple solution instead:
Redirect /blog /weblog
Now blog/something just redirects to weblog/something. The redirect costs the view an extra network back and forth but oh well.

Comments

July 13, 2011, Colin
Hey, if I had known you were OK with a redirect I would have recommended that in the first place! I thought you wanted to keep /blog working explicitly.