URLs

Bojana Knezevic asked on October 20, 2017 16:25

In which table in database live urls are stored? My guess was CMS_Document table (DocumentUrlPath), but that doesn't seem to be right. Kentico 7 is the version I'm using.

Thank you in advance!

Recent Answers


Matt Nield answered on October 20, 2017 16:44 (last edited on October 20, 2017 17:01)

Bojana, live URLs are not necissarily stored in one place; you need to look though the hierarchy of the content tree to determined the full URL. There are quite a few different settings tha cen effect the URL that is used. CMS_Document certainly contains alot of the componet parts. A route you can use is to take the NodeAliasPath from the CMS-Tree table. This may not take in to account any additional URL settings though.

It's worth asking what you want to use it for, if you'r eplanning to modify it in any way, then changing the CMS_Document.DocumentURLPath and CMS_Document.DocumentUseNamePathForUrlPath would be the way forward. For example:

UPDATE CMS_Document 
SET DocumentURLPath = '/awesome-url', DocumentUseNamePathForUrlPath=0
WHERE DocumentID=15

You'll need to flush your cache no doubt after this.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on October 20, 2017 17:33

I've be very careful about updating URL's directly in the SQL table(s) because different settings can affect which field(s) are updated. Updating a field directly in SQL doesn't take those site settings into consideration or handle any workflow or versioning.

That being said, look for the problem and attempt to resolve it via the UI before writing SQL for it.

1 votesVote for this answer Mark as a Correct answer

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