2011-08-03 93 views
-1

我在網站上工作,他們是用戶配置文件,現在我想顯示配置文件名稱或通過.htaccess說用戶名。例如:我的網站有一個用戶的配置文件中的鏈接中給出希望.htaccess顯示名稱而不是id?

http://websoftnet.com/projects/uklasertherapy/?page_id=62&th_id=3 

,我想的.htaccess顯示此

http://websoftnet.com/projects/uklasertherapy/profile/saeed 

我怎樣才能做到這一點通過的.htaccess?

回答

0

警告:未經測試的代碼

你必須沿着

RewriteEngine on 
RewriteRule ^projects/uklasertherapy/profile/([a-zA-Z])/$ projects/uklasertherapy/profile.php?name=$1 

凡行.htaccess文件profile.php將採用變量name從GET參數中獲取並獲取具有該名稱的用戶的頁面。

相關問題