这是我的根的while
:
.htaccess
为了缩短网址,我成功地使用了它:
RewriteEngine on
RewriteCond %{request_filename} -f
RewriteRule ^(.*) $1 [L]
RewriteRule ^(([^/]*)+)(/([^/]{0,32})(/.+)?)?$ index.php?a=$1&q=$3 [L]
在这种情况下,网址RewriteRule ^explore/([^/]+)/?$ index.php?a=explore&filter=$1 [NC]
成为https://example.com/index.php?a=explore&filter=latest%20music
我的问题从这里开始......如果我缩短这个网址:
https://example.com/explore&filter=latest%20music
使用此规则:
https://example.com/index.php?a=search&q=something
重定向不起作用,我最终在一个未定义的页面上。
这是我搜索的JS函数:
RewriteRule ^search/([^/]+)/?$ index.php?a=search&q=$1 [NC]
这是我的完整function manageResults() {
var q = $("#search").val();
liveLoad('search&q='+q.replace(' ','+'));
}
:
.htaccess
我的RewriteEngine on
RewriteCond %{request_filename} -f
RewriteRule ^(.*) $1 [L]
RewriteRule ^(([^/]*)+)(/([^/]{0,32})(/.+)?)?$ index.php?a=$1&q=$3 [L]
RewriteRule ^explore/([^/]+)/?$ index.php?a=explore&filter=$1 [NC]
RewriteRule ^search/([^/]+)/?$ index.php?a=search&q=$1 [NC]
RewriteRule ^welcome/([^/]+)/?$ index.php?a=welcome&filter=$1 [NC]
进行实时搜索:
function.js