Redirect an url/path/pattern to a specific page with in the kentico website

Vinod Vutla asked on June 22, 2016 14:51

How can I assign the following url to the root page as alias path in my website. http://domainname.com/memberguide/index.php#!home.html.

When I browse the above url it should redirect to http://domainname.com(home page for exmaple)

By default few of the characters are forbidden in our kentico system, so I added following key in the web.config to exclude . and # characters. <add key="CMSForbiddenURLValues" value="$\/:?"<>|&%'[] =" />

But IIS is not allowing me to browse .php or .html extensions. Can I truly redirect the above url to the root page, please assist me.

Correct Answer

Vinod Vutla answered on April 30, 2018 07:00

Thanks for your Help Dawid.

I did it as mentioned below

  1. Allowed the kentico url settings to accept the extensions like .htm, .html, .php etc.
  2. IIS Rewrite module was used to write few rules to match a pattern and then trigger a 301 redirection
  3. Have written JavaScript to handle the #url, because asp.net itself ignores the path after the hash in request context.
0 votesVote for this answer Unmark Correct answer

Recent Answers


Dawid Jachnik answered on June 22, 2016 15:12 (last edited on June 22, 2016 15:27)

Hello,

You can't do it without little customization.

First you need to enable the custom url extensions like .php https://docs.kentico.com/display/K9/Extensionless+and+custom+URLs (Using custom URL extensions )

Then you can setup the redirect from .php to other one within Kentico.

But this customization doesn't work for index.php#!home.html to make this work I think you should use rewrite IIS module, there you can specify more advanced path expressions. http://www.iis.net/learn/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module

Or just simply use the module from Marketplace http://devnet.kentico.com/articles/url-redirection

1 votesVote for this answer Mark as a Correct answer

Vinod Vutla answered on June 22, 2016 16:23 (last edited on June 22, 2016 16:54)

Dear Support,

With https://docs.kentico.com/display/K9/Extensionless+and+custom+URLs (Using custom URL extensions ) I can redirect urls with .php or .html extension.

If I have a url like http://www.domainname.com/resorts#, aliaspath converting '#' character into '-' because '#' is a forbidden character.

I tried to remove the # from default forbidden characters by adding the key in web.config. Now when I browse the url http://www.domainname.com/resorts#, its giving 404 page not found error with in the kentico site(its not an IIS 404 error). How can I handle the above type of urls which contains forbidden characters.

Can I rewrite the complex patterns which contains forbidden characters using url rewritting module?

0 votesVote for this answer Mark as a Correct answer

Vinod Vutla answered on June 22, 2016 20:06

Hi Team,

Let me know your feedback on this issue.

0 votesVote for this answer Mark as a Correct answer

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