我无法使用 .htacess
file 和 url 别名和 GET
方法检索值
.htaccess file
<IfModule mod_rewrite.c>
# Enable Rewriting
RewriteEngine on
RewriteRule ^search-location/(w+)/?$ findjob4.php?loc=$1
</IfModule>
findjob.php file
if (isset($_GET[ loc ]) or !empty($_GET[ loc ])) {
$d_location = $_GET[ loc ];
echo "Location : " . $d_location;
}
下面是操作 我做了什么,
URL 1 : www.example.com/search-location/london
ouput : Location : london
status : Good
URL 2 : www.example.com/search-location/north-london
output : Error 404 , Object not found!
Status : The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
URL 3 : www.example.com/search-location/north%20london
output : Error 404 , Object not found!
Status : The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
But i could not get the values of those GET
method loc
variables, if i give a . .
(space) or -
(hypen) between url values.
how do i get the values from the url..
感谢 谢谢