开发者

mod_rewrite - fixed and variable query string params

I want to send

www.mydomain.com/approve/SomeFunkyVar开发者_JS百科iable to

www.mydomain.com/home/index.php?option=com_content&task=view&id=574&Itemid=85&approve=someFunkyVariable

What is the rule for this?


Completely ignoring the params (considering you haven't mentioned them)

RewriteEngine on
RewriteRule ^approve/([^/\.]+)/?$ index.php?option=com_content&task=view&id=574&Itemid=85&approve=$1 [L]

To include the params you'll need a url like

www.mydomain.com/com_content/view/547/85/approve/SomeFunkyVariable

RewriteEngine on
RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)?$ index.php?option=$1&task=$2&id=$3&Itemid=$4&$5=$6 [L]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜