Redirect from one subdirectory another

KRISHNA PRASAD E G asked on March 25, 2014 02:20

I want to redirect the following urls with out writing separate 301 redirection in web.config.

mydomain.com/test/  to mydomain.com/test1/
mydomain.com/test/sample/  to mydomain.com/test1/sample/
mydomain.com/test/abc/  to mydomain.com/test1/abc/

Is there a best practice here or recommendations from the community?

Correct Answer

KRISHNA PRASAD E G answered on March 25, 2014 04:58

<rule name="test Redirect" stopProcessing="true">
     <match url="^(test/)(.*)$" />                  
     <action type="Redirect" url="http://www.mydomain.com/test1/{R:2}" redirectType="Permanent" />
 </rule>
1 votesVote for this answer Unmark Correct answer

Recent Answers


KRISHNA PRASAD E G answered on March 25, 2014 04:48

We can create a rule in web.config

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on March 25, 2014 07:44

Kentico handles this without modifying your web.config. I'd suggest reading up on their documentation. If /Test1 is an actual document within your content tree, you can add a URL alias to that document of /Test. By default when /Test is requested it will serve up /Test1. If you want it to fully perform a redirect, then change your settings in the Site Manager>Settings>URLs and SEO to Allow permanent (301) redirection and Redirect document aliases to main URL. This will then perform a 301 redirect when /Test is requested to /Test1.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.