Remove prefix from url

Benjamin Chew asked on March 14, 2018 10:38

I saw that some of my resource path seems to have prefix some does not have

for example,

some css file is loaded with following path

  • http://mysite.coy.com/Site/css/some.css
  • http://mysite.coy.com/Site/images/logo.png

some css and js file is loaded with the following path

  • http://mysite.coy.com/css/some.css
  • http://mysite.coy.com/js/some.js

i would like to check how do i make it such that all the resource are loaded with the path that is without /Site?

for example

  • http://mysite.coy.com/css/some.css
  • http://mysite.coy.com/images/logo.png
  • http://mysite.coy.com/css/some.css
  • http://mysite.coy.com/js/some.js

Recent Answers


Rui Wang answered on March 14, 2018 14:02

From Kentico side, if you upload images into media library, then the path would be something like .com/sitecodename/media/libraryname/filename.png

For CSS and JS that are managed through CMS, there is not prefix for the site name.

If you want to manager CSS and JS directly in file system, then you can put them under /css or /js folder like traditional website.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on March 14, 2018 14:42 (last edited on March 24, 2018 12:16)

First ensure your website is setup properly in IIS. https://devnet.kentico.com/questions/remove-sitename-from-site-urls

Secondly, after you've corrected/verified how your site is setup make sure you modify your urls. I'm guessing they are hard coded.

Lastly, make the URL relative OR use a macro to get the correct absolute URL. {% GetAbsoluteURL("/css/some.css") %}

1 votesVote for this answer Mark as a Correct answer

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