creativejay Posted February 26, 2015 Posted February 26, 2015 I am working on migrating a site from MODX to PWire. On the previous site, the page URLs ended in .html or sometimes .xml, and I'm hoping there's some way to write the URLs of the PWire site to end with delimiters. In most cases it's just to avoid the inconvenience of a redirect, but in at least one case there's a dependency on those URLs from outside applications (an iOS app checks the product list via a URL that ends in .xml, for example). Thanks!
Soma Posted February 26, 2015 Posted February 26, 2015 Just add .xml to the name ans disable trailing slashes. 6
Mike Rockett Posted February 27, 2015 Posted February 27, 2015 Didn't know you could do this. After all, the field descriptor says "Any combination of letters (a-z), numbers (0-9), dashes or underscores (no spaces)."
creativejay Posted February 27, 2015 Author Posted February 27, 2015 I thought I had tried something like that before, but I maybe I hadn't deactivated the trailing slash in the template URLs tab. Thank you!
creativejay Posted March 4, 2015 Author Posted March 4, 2015 I've disabled trailing slashes in the template, but across the site page references are still including a trailing slash. This is affecting Redirects and other things. The page loads correctly in the browser URL bar, but this is hindering some things from working properly. Has anyone run into this who knows a workaround or a fix? It's discussed already a bit in this thread: https://processwire.com/talk/topic/148-release-redirects/?p=88898 ... but it's bigger than just that module so I figured I'd bring it back here.
Macrura Posted March 4, 2015 Posted March 4, 2015 you could also hook into page path and do your custom page name without the trailing slash, so the page references render the correct url;
Soma Posted March 4, 2015 Posted March 4, 2015 I can't reproduce this. I have basic-page without trailing slash and a page field to select pages. The url of those don't have a trailing slash.
creativejay Posted March 6, 2015 Author Posted March 6, 2015 Here is what's happening for me, the biggest problem I'm running into is that Redirects won't function properly with this setup. Here is the trailing slash setting of the template. Here is the Settings tab of a page using that template. Here is the system message upon saving. Setting up a redirect by selecting the page The Page is not saved and the system message shows the slash again. It also does not save the "Redirect To" field if I manually enter the page path. As you can see from the screen shot of the Redirects list, I have some that link to a page ending in .html/ In these cases I changed the template to remove the trailing slash AFTER setting up the redirect, in the hopes it would retain that page. It does.. until I go to update it... Then the URL is invalidated. As I said, if I view the URL directly, it loads without the trailing slash in the URL, but there seems to be an issue with the system actually respecting that setting down to the core level. Anyone have any thoughts? Appreciate your help!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now