2012-08-02 33 views
0

这是链接链接URL http://djmobi.in/?dir=/Mobile_Ringtones & P = 1级&排序= 1/Mobile_Ringtones.html改变使用.htacces

请告诉我如何删除?dir =从上面的链接我想让它看起来像下面的链接,例如。

http://www.finewap.com/Category/9497/Mobile_Ringtones.html

+0

你读过关于['mod_rewrite'](http://httpd.apache。组织/ d OCS /电流/ MOD/mod_rewrite.html)? – tiwo 2012-08-02 07:13:02

回答

0

你一定没有想到办法“如何删除?dir=”,而是“哪一个环节,而不是这个复杂的使用”。

这是.htaccess的kinf你将需要:

RewriteEngine On 
RewriteBase/

RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f 

RewriteRule ^([A-Za-z0-9-]+)\.html$ index.php?dir=$1 [L] 

.htaccess将重定向每个URL像http://www.domain.com/foo.htmlhttp://www.domain.com/index.php?dir=foo(这将是透明的)

这是一个好的开始,我让你搜索一些文件来添加你的页面和排序管理(我们没有足够的数据给你一个工作的代码)

+0

**我尝试了很多,但没有奏效。以下是我的index.php文件代码** **我已经从index.php中删除了index.php?dir = ** **它现在只是吗?dir = ** **我的链接例如:http: //www.djmobi.in/?category=/Full_Mp3_Songs&p=1&sort=1/Full_Mp3_Songs.html** 我这里有完整的代码文件[我的index.php代码] [1] 和我的htaccess的文件在这里[我的.htaccess文件代码] [2] [1]:http://djmobi.in/code.txt [2]:http://djmobi.in/htaccess.txt – Emran 2012-08-04 13:13:46