[英].htaccess rewrite from base (http://domain.com/catch-this)
I wonder how I should do accomplish the following. 我不知道该如何完成以下任务。
Catch URL's like the following: http://domain.com/blue-boats send to myfile.php?header=1$ 捕获URL,如下所示: http ://domain.com/blue-boats发送到myfile.php?header = 1 $
I don't want it to have this structure: http://domain.com/boats/blue-boats 我不希望它具有以下结构: http : //domain.com/boats/blue-boats
I've tried this, but it doesn't work properly: 我已经尝试过了,但是不能正常工作:
RewriteRule /$ myfile.php?header=$1
just put .htaccess in the documentroot of http://domain.com/ with similiar content to the following: 只需将.htaccess放在http://domain.com/的documentroot中,其内容类似如下:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^/([^/]*)/?$ /myfile.php?page=$1 [L]
</IfModule>
尝试:
RewriteRule (.+) myfile.php?header=$1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.