开发者

Redirect based on part of url

How do I do an apache redirect to a startic splash page based on a dynamic url. Part of the url is always static. For example, http://buy.domain.com/product/product1-name-here

What do I need to do开发者_StackOverflow if I want to redirected everything that comes in http://buy.domain.com/product/* to a certain page?


Just try this simple rule in .htaccess file:

RewriteEngine on
Options +FollowSymlinks -MultiViews

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


In your .htaccess file, create an Apache RewriteRule to selectively choose links based on a regular expression.

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜