.htaccess友好的URL不起作用

时间:2014-05-27 23:48:59

标签: php apache .htaccess url mod-rewrite

我有一个如下所示的网址:

http://domain.com/directory/?page=2

但是,我想使用.htaccess并使它看起来像这样:

http://domain.com/directory/page/2/

相信我,我一直在Google上搜索解决方案几个小时,但我一直收到500内部服务器错误。这是我尝试使用的代码 - 该文件位于“目录”目录(.htaccess rewrite GET variables)中:

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?page=$1 [NC]

0 个答案:

没有答案