2013-08-27 59 views
1

我見過的網站已經用其他東西取代了原來的網址。示例:代替使用http://url.com/profile/index.php?username=USERNAME他們正在使用http://url.com/profile/USERNAME用.htaccess或其他東西代替網址?

我該如何做?

+0

http://stackoverflow.com/questions/3033407/htacces-to-create-friendly-urls -help需要的?RQ = 1 –

回答

0

啓用mod_rewrite的,並通過httpd.conf的.htaccess,然後把這個代碼在你.htaccessDOCUMENT_ROOT目錄:

Options +FollowSymLinks -MultiViews 
# Turn mod_rewrite on 
RewriteEngine On 
RewriteBase/

RewriteRule ^(profile)/([^/.]+)/?$ /$1/index.php?username=$2 [L,QSA,NC]