如何使用htacess隐藏$ _GET参数?

时间:2016-07-28 02:19:37

标签: php .htaccess url url-rewriting custom-wordpress-pages

我想仅在特定页面的url中隐藏$ _GET参数的值。 $ _GET参数的值是动态创建的。

当前网址:

http://example.com/page/info/?name=Barbara&birth=1978-05-07

我想要的是:

http://example.com/page/info/

我尝试使用此htaccess隐藏网址中的$ _GET参数,但它无效:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

RewriteRule ^([a-z0-9]+|)/?$ index.php?name=$1&birth=$2 [QSA,NC]

0 个答案:

没有答案