1
HTTTP://www.site.ru/company.html名= bestcompany
到
HTTTP://www.site .ru/company/bestcompany.html
请建议我错在哪里。我做什么:
RewriteRule ^company/([^/]*)\.html$ /company.html?name=$1 [L]
CMS镆铘,在根文件夹.htacces,全面的.htaccess代码:
RewriteEngine On
RewriteBase/
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.site\.ru [NC]
RewriteRule (.*) http://www.site.ru/$1 [R=301,L]
# The Friendly URLs part
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
RewriteRule ^company/([^/]*)\.html$ /company?name=$1 [L]
谢谢,但它不帮助。 – 2014-12-02 06:24:31
该评论也无济于事。提供详细信息什么是您在浏览器中输入的完整URL以及您得到了什么错误? – anubhava 2014-12-02 06:28:29
完整的网址:htttp://www.site.ru/company.html?name = firstcompany它没有错误,我知道.htacees友好的URL部分工作,但url不会更改为htttp://www.site.ru /company/firstcompany.html – 2014-12-02 06:30:27