1
我想重寫URL的一部分:重寫部分URL .htaccess或Javascript?
我需要這樣的:
http://example.com/subdir/form.php?email=sampleemail%40gmail%2com&name%20(awf_first)=John&name%20(awf_last)=Richardson
要被改寫爲:
http://example.com/subdir/form.php?email=sampleemail%40gmail%2com&first_name=John&last_name=Richardson
所以基本上: - 名稱%20(awf_first)改寫成名字 - 名稱%20(awf_last)重寫爲姓氏
我嘗試使用.htaccess RewriteRule,但它沒有發揮出來:
# Enable Rewrite Engine
RewriteEngine on
#Create friendly URL
RewriteRule ^&first_name=$ &name%20(awf_first)= [L]
#Create friendly URL
RewriteRule ^&last_name=$ &name%20(awf_last)= [L]