How can I replace .html extension with a /

Hi

I’m looking to move all of my wordpress blog post content over to static webpages on freeway, but I need to keep the urls how they were on my blog

The problem is that on the blog the urls all end with a simple trailing slash, but in freeway, they all and in .html, so all the back-links I built would be lost of these urls differ when I transfer them over

So, how can I change a page in freeway that is say:

www.mypage/blog/post.html

to:

www.mypage/blog/post/


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

There’s at least three things you could try. One would be to see if your host has ContentNegotiation on, or ask them to enable it. Another would be to make a ModRewrite rule to change requests for pagename/ to pagename.html silently (without reporting the change back to the browser). The last would be to make a new folder for each page (named for that page), move the page into it, and rename the page index.html. This last would be the most work for you, but would be the lowest-tech and therefore least likely to cause problems. The first might not work – I can’t recall if ContentNegotiation tries to find a match for a folder name or not. (It would definitely work if you could somehow drop all the trailing slashes from your links.)

I believe mod rewrite is your best route here, unless you only have a few pages to fix this way.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks Walter

So this sounds pretty tricky and inconvenient no matter which route I take.

Was hoping there would be a simple solution in freeway - I see I can change a page from .html, to .php easily, but not to a simple backslash, which is frustrating

I’ll have a look at your mod re-write suggestion…

Thanks again


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

A forward slash (not a backslash – really – this isn’t Windows!)
indicates a directory, or folder. It’s completely unambiguous. That’s
why slashes are illegal characters in a filename, just as the colon
was in Classic Mac OS (where it served the same purpose in a file path).

If you remove the extension from the filename (and I don’t believe
Freeway will let you do this, I’m just saying for purposes of
explanation) then you do have an ambiguous URL. It might be a folder,
just someone left off the trailing slash. It might be a filename, but
someone left off the extension to indicate what sort of file it is.
Either way, Apache goes through this little dance to see if it can
figure out what to do.

If there’s a file in the folder (indicated by the last slash in the
URL) that is on Apache’s list of file-types that it can legally serve,
then that file gets served. So if your URL ended in folder/products
(note the lack of trailing slash) and there was a file in the ‘folder’
called products.html, then a request for folder/products would be
silently filled with folder/products.html. If you had more than one
products.??? file in the same folder, then Apache would offer you a
choice of which one you meant.

Walter

I see I can change a page from .html, to .php easily, but not to a
simple backslash, which is frustrating


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Ah yes, it’s a forward slash that I’m looking for, not a backslash - my mistake!

I think your idea of creating a new folder for each page is the way forward for me. It will take a long time to do it for 50 blog posts, but it will be worth it.

Cheers again

Bill


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options