Redirect all traffic from one folder to another

I have a blog hosted at say domain.com/site but have built a new website. I want to redirect all traffic from domain.com/site/anything to domain.com/home/ so that any traffic going to any page or file on the old site gets redirected to the new homepage.

I am unsure what code to place in the .htaccess file and also where on the server to place it

Answers


Simply:

Redirect 301 {old path} http://domain.com/{new path}

you can place that at the root of your website, with the old path and Apache will redirect to the new site.

In your case:

Redirect 301 /site/anything http://domain.com/home

Need Your Help

Evaluate a Math Expression given in string form without using API

java string math

I want to evaluate an expression like -4-12-2*12-3-4*5 given in a String form without using API as I am a beginner and want to grasp the logic.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.