0
我想表现出以下网址http://example.com/folder1/如何查询使用HTTP主机
字符串,但这个网址使用HTTP主机
和执行URL是
http://example.com/?test=folder1
我想表现出以下网址http://example.com/folder1/如何查询使用HTTP主机
字符串,但这个网址使用HTTP主机
和执行URL是
http://example.com/?test=folder1
将这个代码在你DOCUMENT_ROOT/.htaccess
file:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/?$ /?test=$1 [L,QSA]
this this是正确的,但我想“http://example.com/folder1/”这个网址用作http主机,当我把echo $ _SERVER ['HTTP_HOST']; 这是如何http://example.com/folder1 – user3334126
不理解您的评论。 '$ _SERVER ['HTTP_HOST']'将成为'example.com' – anubhava