2
如何使用.htaccess重寫規則顯示以下URL?參數?如何使用PHP中的.htaccess從URL中獲取參數
Original URL
http://example.com/index.php?store=1
Desired URL
http://example.com/1/
OR
Desired URL
http://example.com/store/1
我嘗試以下在.htaccess代碼。我在這裏錯過了什麼?
RewriteEngine On
Options +Followsymlinks
RewriteCond %{REQUEST_FILENAME} !-f
rewriteRule ^store/(.+)\$ index.php?store=$1 [L]
我的index.php文件有這個代碼
<?php
$storeid = $_GET['store'];
echo $storeid;
?>
我是缺少在這裏?