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?
精彩评论