【发布时间】:2011-12-07 01:03:34
【问题描述】:
假设我有带有如下查询字符串参数的 URL:
index.php?lag=en&name=About Us&itemid=60
index.php?host=consumer&lag=en&name=About Us&itemid=64
使用 mod_rewrite,我怎样才能像这样重定向它们?
en_About Us_60.php
consumer/en_About Us_64.php
在上面的网址中,值是动态的。
【问题讨论】:
-
我很确定你的意思是相反的,你希望 url 显示在 en_About Us_60.php 中为用户并重定向到 index.php?lag=en&name=About Us&itemid=60 fot应用程序,不是吗?您确定要重定向还是只是透明重写?
-
是的,我想重定向 index.php?lag=en&name=About Us&itemid=60 index.php?host=consumer&lag=en&name=About Us&itemid=64 这两个动态 url 到静态 url,比如 en_About Us_60.php 消费者/en_关于我们_64.php 这个。请帮帮我
-
你说是,然后你说与我的句子相反...在你的问题中写下用户的 url 和你的应用程序的 url。您有 en_About Us_64.php 文件吗?
标签: apache mod-rewrite