Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess 用参数重写url_.htaccess - Fatal编程技术网

.htaccess 用参数重写url

.htaccess 用参数重写url,.htaccess,.htaccess,下面是我正在使用的htaccess文件。我的分页url为domain.com/?page=1。现在,这只获取第一页记录,而不获取下一页记录,即使domain.com/?page=2已传递到url。 我怀疑这是因为重写url,因为它在本地主机上工作正常,而在服务器端只获取第一页记录 <IfModule mod_rewrite.c> AddHandler application/x-httpd-php72 .php RewriteEngine On # Removes i

下面是我正在使用的htaccess文件。我的分页url为domain.com/?page=1。现在,这只获取第一页记录,而不获取下一页记录,即使domain.com/?page=2已传递到url。 我怀疑这是因为重写url,因为它在本地主机上工作正常,而在服务器端只获取第一页记录

<IfModule mod_rewrite.c>
AddHandler application/x-httpd-php72 .php
    RewriteEngine On
    # Removes index.php from ExpressionEngine URLs  
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?url=$1 [PT,L]

</IfModule>

通过将重写url更改为RewriteRule ^.*$index.php?url=$1[QSA,PT,L]。它解决了我的问题