【发布时间】:2012-04-11 08:32:48
【问题描述】:
我需要重定向任何 www.mysite.com/anything/anything 或 www.mysite.com/anything 并排除 www.mysite.com/应用程序
到 www.mysite.com/app
当然我要排除是可选的。这只是一个额外的重定向,我想这会花费额外的时间,不过最好将其排除在外。
我找到了这些基本示例http://www.yourhtmlsource.com/sitemanagement/urlrewriting.html 并做到了这一点:
RewriteRule ^*/*/$ /app
RewriteRule ^*/$ /app
但它不起作用,而且我仍然不知道如何排除 /app
请帮忙?
更新
我认为 .* 代表正则表达式中的 0 个或多个点,我的示例完全错误,我需要 anything syntax 而不是您在答案中使用的点。
【问题讨论】:
标签: php regex .htaccess mod-rewrite redirect