htaccess工作,但内容不加载

问题描述:

当我使用index.php?id = this-is-an-article页面加载内容,当我使用/ articles/this-is-an-article页面加载没有任何内容,对我如何解决这个问题有任何想法?htaccess工作,但内容不加载

的.htaccess:

Options +FollowSymLinks 
RewriteEngine On 
RewriteBase/

# force www. in all requests 
RewriteCond %{HTTP_HOST} ^mysite\.net [NC] 
RewriteRule ^(.*)$ http://www.mysite.net/$1 [L,R=301] 

# enable hiding php extension 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME}\.php -f 
RewriteRule ^(.*)$ $1.php 
RewriteRule ^(.*)\$ $1.php 

RewriteCond %{SCRIPT_FILENAME} !-d 
RewriteCond %{SCRIPT_FILENAME} !-f 
RewriteRule ^page/(\d+)*$ ./index.php?p=$1 

# index.php?id=this-is-an-article => /articles/this-is-an-article 
RewriteRule /articles/(.*) index.php?id=$1 [NC,L] 

在此先感谢。

+0

做一些调试输出startes:''

和 – nitro2k01 2011-03-19 09:08:08

摆脱主导斜线。最好的做法是用^开始像这样的正则表达式,并以$结尾。

RewriteRule ^articles/(.*)$ index.php?id=$1 [NC,L] 
+0

的调试输出我得到这个... 阵列([ID] =>这-是-AN-article.php /本 - 这是一篇文章)而这不是我想要的..因为它不是一个.php文件,它应该从数据库拉。 – Hugo 2011-03-19 09:47:38

+0

好的,我修好了。这是隐藏的PHP扩展,塞满了它。 – Hugo 2011-03-19 10:12:41