MODx - Resource Alias breaking plugin - Using pages with “/” in the URL? ( /resources/page.html )

大憨熊 提交于 2019-12-25 02:50:27

问题


I currenlty have a MODx website setup, and I am wondering if it's proper to have my links look like this (And by that I mean my resource alias):

myurl.com/help/configuration/basics.html

Putting the slash in the URL like that... is it a bad practice? My main problem is that this breadcrumb plugin seems to no longer work... :( I want to have this breadcrumb plugin operational again, if someone would mind helping me.

The Error:

When say using the breadcrumb to link to a page that's myurl.com/code/landing.html and the current page is myurl.com/help/configuration/basics.html, it will then redirect you to a link that doesnt exist, that looks like this:

myurl.com/help/configuration/code/landing.html

As you can see, it is appending the latter portion of the new page's url, but it is not properly removing the URL of the current page, as it only removes the current URL up to the '/' slash....

Does anyone know how to fix this? Possibly a way to make it so that instead of doing it's current "remove" and "append" thing, I can change breadcrumbs.class.php to take the value of the links as if I had clicked the link with the "view" button on the MODx manager? I'm not an expert at php, and it is a must for this to work. Or are there other alternatives to creating the " / " effect in my links, rather than just putting it in the resource alias? (As I want the site to follow a logical, readable, order)


回答1:


With all things modx, clear the cache, even if you don't think it could be the issue ~ modx is very aggressive about caching stuff.

Though this kinda sounds like maybe your base href tag may be set to <base href="" />, possibly in your templates it may look like:

<base href="[[++site_url]]"></base>

where site_url is set dynamically [it's not a system setting so don't look for it] in your /core/config/config.inc.php as $modx_base_url ... if that value is blank that could be causing the issue.

Also check your rewrite rules in your .htaccess to see what the rewrite base is. [it should be / ]

then refresh your cache... ;)



来源:https://stackoverflow.com/questions/16027803/modx-resource-alias-breaking-plugin-using-pages-with-in-the-url-reso

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!