Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

.htaccess redirection issues

Avatar of LauraLaura1
LauraLaura1 asked on
ProgrammingInstallationLinux Distributions
2 Comments1 Solution173 ViewsLast Modified:
.htaccess goals:
1) When someone goes to mysite.com/abc it should reroute to http://info.mysite.com/abc
2) Otherwise go to mysite.com/test
And in all cases keep all name value pairs for GETs

What I have isn't working - when I put in mysite.com/abc it redirects to http://www.mysite.com/info.mysite.com/abc instead of http://info.mysite.com/abc. Can you tell me how to fix what I have:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^mysite\.com\/abc$
RewriteRule ^/?$ "http\:\/\/info\.mysite\.com\/abc" [R=301,L]

RewriteCond %{HTTP_HOST} ^mysite\.com$
RewriteCond %{HTTP_HOST} !^info\.mysite\.com$
RewriteRule ^/?$ "http\:\/\/mysite\.com\/test" [R=301,L]

# Use PHP5.4 Single php.ini as default
AddHandler application/x-httpd-php54s .php
Avatar of Edwin Hoffer
Edwin HofferFlag of United States of America imageTechnical Expert
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answers