I am working on setting up an instance of Mango Blog on an Ubuntu Server running Apache 2 HTTPD and Tomcat 6 with Railo 3.1.2. I was able to get everything setup until I started trying to implement URL rewriting for the blog URLs.
I used a combination of Adam Tuttle’s and John Sieber’s posts to get the rewrite rules. I have the site setup as follows:
{webroot}/.htaccess
RewriteEngine on
RewriteBase /
# archives rule must be located before page rule for paging to work correctly
RewriteRule archives/(.*)$ archives.cfm/$1 [PT,L,NC]
RewriteRule page/(.*)$ page.cfm/$1 [PT,L,NC]
RewriteRule post/(.*)$ post.cfm/$1 [PT,L,NC]
RewriteRule author/(.*)$ author.cfm/$1 [PT,L,NC]
{apache-home}/sites-enabled/sitename
<VirtualHost *:80>
ServerAdmin *******
DocumentRoot /var/www/******/www
ServerName mango.*****.com
DirectoryIndex index.cfm
<Directory /var/www/*******.com/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/error-*******_com.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access-********_com.log combined
ProxyPreserveHost Off
ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ ajp://********.com:8009/
</VirtualHost>
When I visit blog posts by going to /post/hello-world on the site I get a 404 error. If I go to /post.cfm/hello-world the post comes up just fine. I tried the rewrite rules against a rewrite tester, and that said that the rewrites should work fine. I am very new to rewriting, so I apologize if this is something simple.
Put in your .htaccess file: