subtil
asked on
htaccess mod_rewrite based on day of the month
Dear experts
I wish to redirect my domain to subdomain using day of the month.
e.g
5th of the month redirect ( abc.com and Anything.abc.com ) to five.abc.com
17th of the month redirect ( abc.com and Anything.abc.com ) to seventeen.abc.com
If visitors type the following url on 5th:
www.abc.com REDIRECT TO five.abc.com
abc.com REDIRECT TO five.abc.com
direct.abc.com/download REDIRECT TO five.abc.com/download
whatever.abc.com/images/in dex.htm REDIRECT TO five.abc.com/images/index. htm
Note:
If they type
five.abc.com on 6th, they will need to be redirect to six.abc.com as well
Currently i am trying with this codes, but there is a loop error
Options +SymLinksIfOwnerMatch
RewriteEngine On
RewriteCond %{TIME_DAY} ^1
RewriteRule ^(.*) http://one.abc.com/$1 [R=301,L]
RewriteCond %{TIME_DAY} ^2
RewriteRule ^(.*) http://two.abc.com/$1 [R=301,L]
RewriteCond %{TIME_DAY} ^3
RewriteRule ^(.*) http://three.abc.com/$1 [R=301,L]
List of subdomains
one.abc.com
two.abc.com
three.abc.com
four.abc.com
five.abc.com
six.abc.com
abc.com <- i am not using this
www.abc.com <- I am not using this
Thank you!
I wish to redirect my domain to subdomain using day of the month.
e.g
5th of the month redirect ( abc.com and Anything.abc.com ) to five.abc.com
17th of the month redirect ( abc.com and Anything.abc.com ) to seventeen.abc.com
If visitors type the following url on 5th:
www.abc.com REDIRECT TO five.abc.com
abc.com REDIRECT TO five.abc.com
direct.abc.com/download REDIRECT TO five.abc.com/download
whatever.abc.com/images/in
Note:
If they type
five.abc.com on 6th, they will need to be redirect to six.abc.com as well
Currently i am trying with this codes, but there is a loop error
Options +SymLinksIfOwnerMatch
RewriteEngine On
RewriteCond %{TIME_DAY} ^1
RewriteRule ^(.*) http://one.abc.com/$1 [R=301,L]
RewriteCond %{TIME_DAY} ^2
RewriteRule ^(.*) http://two.abc.com/$1 [R=301,L]
RewriteCond %{TIME_DAY} ^3
RewriteRule ^(.*) http://three.abc.com/$1 [R=301,L]
List of subdomains
one.abc.com
two.abc.com
three.abc.com
four.abc.com
five.abc.com
six.abc.com
abc.com <- i am not using this
www.abc.com <- I am not using this
Thank you!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Will look into it in deep.