我试图弄清楚有关三个条件的规则
我的网站网址的几个例子是
example.com/?page=search 我希望它像 example.com/search
example.com/?page=username&profile=overview 我希望它像 example.com/username/overview
example.com/?page=result&pn=1 我希望它像 example.com/result/1
我有像这样的jQuery帖子请求
$.post('config/post-ajax.php', "zilla="+el.val()).success(function(data) {
var data = $.parseJSON(data);
$('.rm1').remove();
for (var i = 0; i < data.length; i++) {
$("#thana").append("<option class=\"rm1\" value="+data[i]+">"+data[i]+"</option>");
}
});
&#13;
答案 0 :(得分:0)
这应该像你表达它一样:
RewriteEngine On
## Show 404 for all .php files except index.php
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{REQUEST_URI} !^/?index\.php$ [NC]
RewriteCond %{REQUEST_URI} \.php$ [NC]
RewriteRule ^(.*)$ - [R=404,L]
## Redirect 301 with one query parameter
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{QUERY_STRING} ^page=([^&]*)$ [NC]
RewriteRule ^(.*)$ /%1? [R=301,L]
## Redirect 301 with two query parameters
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{QUERY_STRING} ^page=([^&]*)&[^=]*=([^&]*)$ [NC]
RewriteRule ^(.*)$ /%1/%2? [R=301,L]
## Redirect 301 with three query parameters
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{QUERY_STRING} ^page=([^&]*)&[^=]*=([^&]*)&[^=]*=([^&]*)$ [NC]
RewriteRule ^(.*)$ /%1/%2/%3? [R=301,L]
## Start: rewrite all to index.php
RewriteBase /
RewriteCond %{REQUEST_METHOD} !POST
# except all real files like images, css, js, etc.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* index.php [L]
答案 1 :(得分:0)
最后我自己做了。以下是工作规则
Illuminate\Foundation\Auth\User