How can I get clean URLs?
See original GitHub issueI have some html files that I want to serve up, but I don’t want to put the file extensions in the names of the files, because I want clean URLs.
Can I have html files with names like index
, about
, and still serve them up like html files to port 8080?
The -e
options doesn’t seem to work when doing http-server -e html site/
. I get no character encoding declared errors in firefox and 404’s on the console.
If I do http-server site/ -e html
then firefox promps me to download the index and about files.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Enable clean URLs - Drupal
Enabling Clean URLs in Drupal 7 · Navigate to the Clean URLs configuration page (Administer > Configuration > Search and metadata > Clean...
Read more >How to figure out which junk you can remove from URLs - Zapier
If you're unsure, just try out the clean URL by pasting it into a browser. If it works for you, it will work...
Read more >URL Clean: Clean Google search result URLs
This tool removes the unnecessary parts, leaving the page's original URL. URL copied from Google search results. Clean it!
Read more >How to make clean URLs - desiquintans.com
This method uses a .htaccess file to tell the server (one running Apache) what to do. The first step is to make a...
Read more >ENABLE CLEAN URLS IN DRUPAL - Robert Menetray
How to find out if clean Urls are enabled · Open an incognito window and go to the home page of your website....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Good to know. I’ll focus my efforts on #160 then, and revisit more complex options later.
For my part, I’d like something similar to the File Handler in wptserve (a Python-based server for running the Web Platform Tests system at the W3C).
I’d like
index
to map toindex.html
(if it exists…and possibly through a series of other media types if found…perhaps optionally). I’d also very much like their.headers
file thing for adding arbitrary headers to responses per file or directory. Super handy for all kinds of things. But decidedly a different issue. 😄I’m going to close this in favor of focusing on #160 and/or filing additional more fixable bugs/features. 😉
Thanks for the feedback @wamoyo!
I ended up doing a bit of a work around, but I did fork this repo and make some adjustments. I’m happy to explore, absolutely : )