2012-08-02 46 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