2017-04-08 106 views
1

我想将我的网址htaccess的短我的网址

accounts.php?cat=cr7-stability&subcat=cr7-atonic-gold-trading 

accounts/cr7-stability/subcat=cr7-atonic-gold-trading 

我创建htaccess文件的代码

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^([^/]+)/([^/]+)$ accounts.php?cat=$1&subcat=$2 [L] 

但是当我测试我得到没有c的旧网址变更

PS。我正在使用在线服务器测试子域 http://cr7.hostato.com/accounts.php?cat=cr7-stability&subcat=cr7-atonic-gold-trading

+0

请尝试清除缓存。 – Akintunde007

+0

我做过了,并且我在不同的浏览器上进行了检查 –

+0

当您在浏览器中输入新的URL时会发生什么?你的规则是否重写了它? – starkeen

回答

2
RewriteRule ^accounts/([^/]+)/([^/]+)/?$ accounts.php?cat=$1&subcat=$2 [L] 
+0

谢谢,但没有改变!可能需要时间才能生效? –

+0

设置链接title

+1

感谢您的编辑@starkeen –