Url参数传递

时间:2014-09-05 04:24:48

标签: php url-parameters

我的基于php的项目我正在使用htaccess来隐藏.php,并在文件名末尾添加了斜杠,我的htaccess文件包含以下规则

Options +FollowSymLinks +MultiViews
RewriteEngine on
# Forces a trailing slash to be added
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]

# disable directory browsing
RewriteCond %{THE_REQUEST} ^.+?\ [^?]+\.php[?\ ]
RewriteRule \.php$ - [F]

RewriteCond %{THE_REQUEST} ^.+?\ [^?]+\.html[?\ ]
RewriteRule \.html$ - [F]

我的网址如下

http://www.example.com/example/

现在我必须通过上面的链接传递参数值10:

<a href="http://www.example.com/example?10/"></a>

但是我的页面显示找不到对象我创建了example.php文件,但参数没有传递并获取页面example.php请帮我如何将参数值10传递给我的example.php文件,上面有htaccess文件条件并解释了如何从example.php文件中获取这些参数值10

0 个答案:

没有答案
相关问题