如何使用htacess使这个:如何使用htacess进行此操作?
http://domain.com/category => /index.php?action=category
http://domain.com/category?query=string => /index.php?action=category&query=string
http://domain.com/category/subcategory => /index.php?action=category/subcategory
http://subdomain.domain.com => /index.php?action=subdomain
http://subdomain.domain.com/category/subcategory => /index.php?action=subdomain/category/subcategory
这是我当前的代码:
RewriteEngine On
RewriteBase/
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)?$ /index.php?action=$1 [L]
你做了什么/试过这么远? – MrJ 2012-02-13 08:20:56
我刚做了前三行 – Aghaie 2012-02-13 08:43:21
它工作吗? .htaccess代码在哪里?因为我没有看到它! – MrJ 2012-02-13 08:45:02