【发布时间】:2014-02-02 00:55:41
【问题描述】:
我使用 Laravel 分页,但网址是这样的:
http://mydomain.com/?page=2
我更喜欢这样的网址:
http://mydomain.com/page/2
我有 htaccess :
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
我试试这条线:
RewriteRule ^/([0-9])$ index.php?page=$1
但它不起作用......有什么想法吗?可以使用 .htaccess 文件以外的其他内容吗?
【问题讨论】:
标签: php .htaccess pagination laravel-4