Search the Community
Showing results for tags 'httpurl'.
Found 2 results
Maybe I'm missing something here, but I'm haveing a hard time to get absolute urls if PW is installed in a subdirectory thought the API... I need an absolute URL for the backend (as a redirect url of Oauth provider). To build the url i would normaly use url()->root.url()->admin – but this results in the install-path beeing present twice; domain.com/path/ + path/admin/ In order to not use $_SERVER['HTTP_HOST'] I fetch the admin page from pages – but this is also not to easy since I need to remove the root folder from path as well. My current solution is somewhat complicated: $backendUrl = pages()->get('path="'.str_replace(urls()->root, '', urls()->admin).'", include=all')->httpUrl; The above code seems to be the savest way to get the absolute url to the backend using pure PW API, am I right? It would be great if one could fetch absolute urls with something like this $backendUrl = urls()->admin->httpUrl // or $backendUrl = httpUrls()->admin SOLVED: Thank you @adrian – of course this HAD to be simpler: urls()->httpAdmin;
Hi there, I was wondering if page->url and page->httpUrl are stored anywhere in the backend? I haven't been able to locate it so I'm beginning to think these are generated or calculated on the fly? Thanks in advance