# BEGIN Bootbeta
<IfModule mod_rewrite.c>
DirectoryIndex index.html index.php
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^example.com$ [NC]RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^abc/(.*)$ abc/$1.php#RewriteCond %{QUERY_STRING} ^name=(.+) [NC]
#RewriteRule ^domain.php$ /domain/%1? [R=301,L]
</IfModule>
# END Bootbeta我想输入 localhost/123456后
调用localhost/del.php处理页面,但url还是123456
del.php取得这个123456
就像空间博客一样解析是怎么做的高手帮看一下,在线泪奔等~~~~~~~~~~~~
<IfModule mod_rewrite.c>
DirectoryIndex index.html index.php
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^example.com$ [NC]RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^abc/(.*)$ abc/$1.php#RewriteCond %{QUERY_STRING} ^name=(.+) [NC]
#RewriteRule ^domain.php$ /domain/%1? [R=301,L]
</IfModule>
# END Bootbeta我想输入 localhost/123456后
调用localhost/del.php处理页面,但url还是123456
del.php取得这个123456
就像空间博客一样解析是怎么做的高手帮看一下,在线泪奔等~~~~~~~~~~~~
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^/zph/(\d+)/?$ /del.php?id=$1&%1 [L,NC]修改后服务器需要重启才能生效
SetOutputFilter INCLUDES
AcceptPathInfo OnAcceptPathInfo On
AcceptPathInfo On
AcceptPathInfo OnAcceptPathInfo On
RewriteRule ^/(\d+)/?$ /del.php?id=$1&%1 [L,NC]
不对啊
我的内容是这样的
# BEGIN Bootbeta
<IfModule mod_rewrite.c>
DirectoryIndex index.html index.php
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
#RewriteCond %{HTTP_HOST} ^mydomain.com$ [NC]RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^/(\d+)/?$ /index.php?id=$1&%1 [L,NC]ErrorDocument 404 /404.html
</IfModule>
# END Bootbeta
我输入localhost/123456
后跳到了404
我输入localhost/index.php?id=123456
可以正常访问
没匹配上???
RewriteRule ^(.*)(\d+)/?$ http://localhost/del.php?id=$1$2 [L]
我这一句话就能改,可是你的两句老跳到404去,改不成
现在发现,我只是让del处理,并不是要改URL RewriteRule不是重改吗
伪静态啊
RewriteRule ^([0-9]+)/?$ test.php?id=$1 [L]
测试localhost/123456
url不变
调用的是test.php也能正确得到123456