<![CDATA[ How to "shorten" url tree in some sites? - My Forums]]> https://forums.modx.com/thread/?thread=104331 <![CDATA[How to "shorten" url tree in some sites?]]> https://forums.modx.com/thread/104331/how-to-shorten-url-tree-in-some-sites#dis-post-561190
For example, having a tree like this:

Root
Categories
------subcategories
----------subsubcategories
--------------Article1.html
--------------Article2.html
--------------ArticleETC.html

My url is becoming too long root/Categories/subcategories/subsubcategories/Article1.html so my SEO is gonna suffer

how can i change the url without moving my articles 2 levels less deep? like:
root/Categories/Article1.html

(NOTE: if succeded, i think i have to do redirects because those deep url no longer exists for Google...)

i certainly dont want to move all my articles manually, because in the future, that would be a pain in the 4SS :/

Thanks
]]>
jacielluve Aug 28, 2018, 02:26 PM https://forums.modx.com/thread/104331/how-to-shorten-url-tree-in-some-sites#dis-post-561190
<![CDATA[Re: How to "shorten" url tree in some sites? (Best Answer)]]> https://forums.modx.com/thread/104331/how-to-shorten-url-tree-in-some-sites#dis-post-561210
RewriteCond %{DOCUMENT_ROOT}/Folder/login/$1.php -f
RewriteRule ^([\w-]+)/?$ Folder/login/$1.php [L]


I think we just had this issue a couple weeks ago but I can't find it.

Save the original file just in case! Be careful!]]>
nuan88 Aug 28, 2018, 09:26 PM https://forums.modx.com/thread/104331/how-to-shorten-url-tree-in-some-sites#dis-post-561210
<![CDATA[Re: How to "shorten" url tree in some sites?]]> https://forums.modx.com/thread/104331/how-to-shorten-url-tree-in-some-sites#dis-post-561207 Quote from: nuan88 at Aug 28, 2018, 04:44 PM
I think this works with Friendly URLs and as you said htaccess re-writing. Did you turn FriendlyURLs on?

You can use a re-write rule to completely eliminate a folder.


yes, i have friendly url.

ill try the rewrite rule as suggested. do you have any example for removing folder from my url.

ill try to test it in a new locally modx install, so i can change files directly XD]]>
jacielluve Aug 28, 2018, 08:30 PM https://forums.modx.com/thread/104331/how-to-shorten-url-tree-in-some-sites#dis-post-561207
<![CDATA[Re: How to "shorten" url tree in some sites?]]> https://forums.modx.com/thread/104331/how-to-shorten-url-tree-in-some-sites#dis-post-561205 Quote from: jacielluve at Aug 28, 2018, 06:02 PM
Quote from: nuan88 at Aug 28, 2018, 04:44 PM
I think this works with Friendly URLs and as you said htaccess re-writing. Did you turn FriendlyURLs on?

You can use a re-write rule to completely eliminate a folder.

I dont know how to do that, and i think its to risky if it fails(dont have ftp so i cant backup and restore the file if failed) XD

i tried the URL freeze(it works doing this), changing the url here will change the url without phisically changing manually the resource. but then i need redirects since the url freeze is changing my url as expected.

How can i do redirects from url to new url? using database table?

Thanks

It is daunting but you should be able to log into your account with your hoster and download the old file and upload the new. I also can't ftp very well.]]>
nuan88 Aug 28, 2018, 07:19 PM https://forums.modx.com/thread/104331/how-to-shorten-url-tree-in-some-sites#dis-post-561205
<![CDATA[Re: How to "shorten" url tree in some sites?]]> https://forums.modx.com/thread/104331/how-to-shorten-url-tree-in-some-sites#dis-post-561204 Quote from: jacielluve at Aug 28, 2018, 06:02 PM
Quote from: nuan88 at Aug 28, 2018, 04:44 PM


How can i do redirects from url to new url? using database table?

Maybe this component will help: https://docs.modx.com/extras/revo/redirector]]> himurovi4 Aug 28, 2018, 06:35 PM https://forums.modx.com/thread/104331/how-to-shorten-url-tree-in-some-sites#dis-post-561204 <![CDATA[Re: How to "shorten" url tree in some sites?]]> https://forums.modx.com/thread/104331/how-to-shorten-url-tree-in-some-sites#dis-post-561203 Quote from: nuan88 at Aug 28, 2018, 04:44 PM
I think this works with Friendly URLs and as you said htaccess re-writing. Did you turn FriendlyURLs on?

You can use a re-write rule to completely eliminate a folder.

I dont know how to do that, and i think its to risky if it fails(dont have ftp so i cant backup and restore the file if failed) XD

i tried the URL freeze(it works doing this), changing the url here will change the url without phisically changing manually the resource. but then i need redirects since the url freeze is changing my url as expected.

How can i do redirects from url to new url? using database table?

Thanks
]]>
jacielluve Aug 28, 2018, 06:02 PM https://forums.modx.com/thread/104331/how-to-shorten-url-tree-in-some-sites#dis-post-561203
<![CDATA[Re: How to "shorten" url tree in some sites?]]> https://forums.modx.com/thread/104331/how-to-shorten-url-tree-in-some-sites#dis-post-561202
You can use a re-write rule to completely eliminate a folder.

For menus, eliminate folder levels from the menu by choosing the parent, and for each resource you can hide it from menus directly.]]>
nuan88 Aug 28, 2018, 04:44 PM https://forums.modx.com/thread/104331/how-to-shorten-url-tree-in-some-sites#dis-post-561202