.HTACCESS redirect /calendar to /events
I need to redirect all traffic from /calendar to /events.
www.domain.com/calendar/sales
to redirect to www.domain.com/events/sales
So I need to开发者_StackOverflow社区 replace calendar with events anyone who goes to the main calendar
page, www.domain.com/calendar
will be redirect to www.domain.com/events
Use the rewrite rule
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/calendar.*$
RewriteRule /calendar((/.*)?)$ /events$1 [QSA,R=301]
In your VirtualHost context.
You need to load mod_rewrite for it to work.
You may try something like this:
RewriteEngine On
RewriteRule ^calendar/(.*)$ events/$1 [R=301,L]
Best
Marco
精彩评论