Hi all,
I searched and searched and couldn't find a reference to this in the mailing list (I know someone asked about this earlier), so I'm asking again. Sorry! :(
I'm launching a new site on the 12th, and I'd like to do something different with this one. Basically, I'd like to change the URL scheme from something like this:
/lenya/pubname/authoring/something/exciting.html
to:
/lenya/pubname/authoring/something/exciting/
There's a lot of legitimate reasons why I want to do this, so I won't go into that here. From what I remember from that question I couldn't find, someone suggested to look at adding something into the publication sitemap to make this happen. Looking at the sitemap, I have to admit that I'm a bit confused.
For one, here's the first pipeline in the default pub:
<map:pipeline>
<map:match pattern="**/">
<map:redirect-to uri="index.html"/>
</map:match>
</map:pipeline>
Now, if I recall correctly, the first pipeline that is matched does it's thing and it's done; no more checking for matches will take place in the sitemap. So, in this case, it would see I have a slash at the end of my URL, like http://localhost:8080/lenya/pubname/authoring/, then it would redirect to http://localhost:8080/lenya/pubname/authoring/index.html, in which case the matching of pipelines happens again, with it matching against index.html. But, doesn't ** match everything and anything, including multiple directories? So, wouldn't the above pipeline also match the following?:
http://localhost:8080/lenya/pubname/authoring/something/
A quick test says that it does, but the document doesn't exist, so I just get a Document Not Found error instead. Why would this be added in this way when this only works for the main page? (Forgive me, I'm thinking through the process as I write this - maybe someone can benefit from this.) So, using the example URL above, the actual document would be:
http://localhost:8080/lenya/pubname/authoring/something.html
With this in mind, would I have to just use the previous folder name? But I don't want to redirect, I actually want the URL to stay the way I want it. But that almost sounds like a rewrite in the Apache config rather than changing the pub's sitemap? For example, would this work? (I'm not in a place to test this right now - I'd much rather keep this on a high level for now to nail how this all works.)
<!-- match just the homepage -->
<map:pipeline>
<map:match pattern="/">
<map:redirect-to uri="index.html"/>
</map:match>
</map:pipeline>
<!-- match anything and everything -->
<map:pipeline>
<map:match pattern="**/*/">
<map:redirect-to uri="{1}/{2}.html"/>
</map:match>
</map:pipeline>
Again, seems strange since it's a redirection rather than being the actual URL, but it seems like I would have to change how Lenya reads pages in order for the change to be perminent. What am I missing?
Jon
Title: Changing default URL scheme
- Changing default URL scheme Linczak, Jonathan W.
- Re: Changing default URL scheme Gregor J. Rothfuss
- Re: Changing default URL scheme Michael Wechner
- RE: Changing default URL scheme Linczak, Jonathan W.
- RE: Changing default URL scheme Linczak, Jonathan W.
- RE: Changing default URL scheme Jann Forrer
- Re: Changing default URL scheme Jonathan Linczak
- Re: Changing default URL scheme Jann Forrer
- Re: Changing default URL scheme Michael Wechner
- Re: Changing default URL scheme Doug Chestnut
