.htacess
ファイルと URL のエイリアシングとGET
値を取得する方法に問題があります
.htaccess ファイル
<IfModule mod_rewrite.c>
# Enable Rewriting
RewriteEngine on
RewriteRule ^search-location/(\w+)/?$ findjob4.php?loc=$1
</IfModule>
findjob.php ファイル
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.
しかし、URL 値の間に (スペース) または(ハイフン) を指定すると、これらのGET
メソッドloc
変数の値を取得できませんでした。URLから値を取得するにはどうすればよいですか... .
-
ありがとう