我尝试使用htaccess
将我的网址格式化为友好网址这是我的网址
我使用了REQUEST METHOD
$id = $_REQUEST['id'];
//Do some thing with php code to get info product from Mysql
$Title = $row['title'];
//Example: Computer 4GB 2CPU
但是当我想搜索我的网站时,它并不好,我希望我的网址是这样的:
答案 0 :(得分:0)
所以在你的.htaccess中,添加:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
RewriteRule ^([0-9a-zA-Z]+)/([0-9a-zA-Z]+)/([0-9a-zA-Z]+)$ index.php?go=$1&id=$2&product=$3 [NC,L]
在<head>
添加以下内容:
<base href="/">
使图像和CSS有效。
为产品添加get方法以获取名称,如果没有继续并发表评论,它应该有效。