Jump to content

Any way to make urls end in .html, .xml, etc?


creativejay
 Share

Recommended Posts

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Here is what's happening for me, the biggest problem I'm running into is that Redirects won't function properly with this setup.

post-1266-0-93146700-1425650373_thumb.pn

Here is the trailing slash setting of the template.

post-1266-0-92873800-1425650410_thumb.pn

Here is the Settings tab of a page using that template.

post-1266-0-51719700-1425650458_thumb.pn

Here is the system message upon saving.

post-1266-0-64843400-1425650542_thumb.pn

Setting up a redirect by selecting the page

post-1266-0-84016500-1425650564_thumb.pn

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...

post-1266-0-65191900-1425650789_thumb.pn

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!

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...