sharat
sharat

Reputation: 1

Redirect to a folder in Django

Django currently has a complete system for routing urls. But I have a very specific situation where I am using django but actually need to use urls like in classic PHP language.

For example: The url - localhost/reader/theeffort should take me to a folder called theeffort where I have my files index.html, 1.html, 2.html, 3.html and so on!

Now all these files should be accessible by localhost/reader/theeffort/*.html and not by Django's default url system. Is this possible to achieve that? If yes, how?

Upvotes: 0

Views: 147

Answers (1)

Daniel Roseman
Daniel Roseman

Reputation: 599796

This isn't a thing you would do with Django's URLs. If you just want to serve HTML files within a folder, they are static files; they should therefore be served by the web server itself, eg Apache. You just need to configure an alias in the Apache conf to point to the folder where the static files are.

Upvotes: 1

Related Questions