繁体   English   中英

根据部分网址重定向

[英]Redirect based on part of url

如何根据动态网址将apache重定向到初始启动页面。 网址的一部分始终是静态的。 例如, http://buy.domain.com/product/product1-name-here
如果我想将http://buy.domain.com/product/ *中的所有内容都重定向到某个页面,该怎么办?

只需在.htaccess文件中尝试以下简单规则:

RewriteEngine on
Options +FollowSymlinks -MultiViews

RewriteRule ^product/.*$ /yourSplashPage? [R,L,NC]

在您的.htaccess文件中,创建一个Apache RewriteRule以根据正则表达式有选择地选择链接。

RewriteRule ^product/.*$ /certainPage.html?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM