Dav*_*ong 7 coldfusion mod-rewrite apache2
我正在使用运行Apache 2 HTTPD的Ubuntu服务器和使用Railo 3.1.2的Tomcat 6设置Mango Blog实例.在我开始尝试为博客URL实现URL重写之前,我能够完成所有设置.
我使用Adam Tuttle和John Sieber的帖子组合来获得重写规则.我的网站设置如下:
{}根目录/.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]
Run Code Online (Sandbox Code Playgroud)
{Apache的家} /启用站点-/网站名称
<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>
Run Code Online (Sandbox Code Playgroud)
当我通过访问网站上的/ post/hello-world访问博客文章时,我收到404错误.如果我去/post.cfm/hello-world这个帖子就好了.我尝试对重写测试器重写规则,并说重写应该工作正常.我很难重写,所以如果这很简单,我道歉.
归档时间: |
|
查看次数: |
589 次 |
最近记录: |