Getting rid of the tilde

It seems that in decommissioning my old blog setup (I got bored keeping up with wordpress security), I removed some useful bits for those of you (thanks to all 3 of you!) who actually read the stuff I write. So here's the rewrite functionality  for removing the ~ character from user pages within apache.


RewriteEngine On
#RewriteLog logs/rewrite.log # Uncomment for rewrite logging
#RewriteLogLevel 3 # uncomment for verbose logging
RewriteCond %{REQUEST_URI} ^/([^/]+)
RewriteCond /home/%1 -d
RewriteRule ^/([^/]+)(.*) /home/$1/public_html/$2


Take that bit of code, and drop it into /etc/httpd/conf.d/homedir.conf or wherever else you’d like in your httpd configs, and reload apache. From there you’ll be able to use shorter, sexier UserDir urls for your user’s webpages.

0 comments:

Post a Comment

Copyright © Bit Integrity