-1
網址:http://localhost/test/quotes/index.php?p=top-games
.htaccess的URL重寫與XAMPP
我需要重寫此爲http://localhost/test/quotes/top-games
我如何做到這一點使用htaccess的文件嗎?請任何一個給我的htaccess代碼。
感謝
網址:http://localhost/test/quotes/index.php?p=top-games
.htaccess的URL重寫與XAMPP
我需要重寫此爲http://localhost/test/quotes/top-games
我如何做到這一點使用htaccess的文件嗎?請任何一個給我的htaccess代碼。
感謝
嘗試在你的文檔根目錄添加這些規則的htaccess文件:
RewriteEngine On
RewriteCond %{THE_REQUEST} \ /test/quotes/index\.php?p=([^&\ ]+)
RewriteRule^/test/quotes/%1? [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^test/quotes/(.+)$ /test/quotes/index.php?p=$1 [L,QSA]