devaneando / Wikitten

Wikitten is a small, fast, PHP wiki, and the perfect place to store your notes, code snippets, ideas, and so on.
MIT License
736 stars 174 forks source link

Default file extension #65

Closed stevenandres closed 7 years ago

stevenandres commented 9 years ago

Would be nice to have cleaner URLs such as

http://server/support (really support.md on disk) http://server/contact (really contact.md on disk) http://server/todo (really todo.md on disk)

and when Wikitten notices there's no extension, it implies ".md" at the end. This allows a "pretty" URL and on disk, still stored as MarkDown. This would require tweaks of the tree.php as well. I made this change in index.php, just after $request_uri = parse_url($_SERVER['REQUEST_URI']);

if( strlen(pathinfo($request_uri['path'], PATHINFO_EXTENSION)) === 0) {
    $request_uri['path'] .= ".md";
}

but I think there's more work to be done

tamano commented 9 years ago

Hi, I have implemented this on a forked project below.

https://github.com/nicosomb/Wikitten/pull/8

Hope it will help.

stevenandres commented 9 years ago

THANK YOU!!!!!! How do I "close" this issue as solved?

tamano commented 9 years ago

We can't :( Maybe @victorstanciu will!

georgesuba commented 7 years ago

@stevenandres you can close your own issue here in reply.. press close on comment instead of comment

stevenandres commented 7 years ago

closing