Forums

.htaccess file location

I need to make some changes to .htaccess file and was wondering where can I locate it. I am trying to get rid of # in Angular/Django integration and as per this

https://scotch.io/tutorials/pretty-urls-in-angularjs-removing-the-hashtag

article I need to overwrite .htaccess file in order to play nicely with Angular.

Hi there, there's no .htaccess file on pythonanywhere that you can edit I'm afraid. Depending on how badly you need this feature to work, you could perhaps re-implement it manually using python code in your web app itself?

Can you please guide a bit on how to create this file, where to put it?

I don't really know enough about angular and what it's trying to achieve I'm afraid... If you don't either, it might be simpler to give up on the "removing the hashtag" idea for now?

How to redirect https://nakedDomain to www.mydomain.com

Take a look at https://help.pythonanywhere.com/pages/NakedDomains/

Hi I'm interested in this.. I also want to make a rewrite rule for my urls

To leave a permanent url that looks like index.. This it's because I don't want users use the url bar to input any code or pk or slug

The best way to do that on PythonAnywhere is to add a route to your Python code to do the redirect. Exactly how you would do that depends on the framework that you're using -- that is, it would be different for Flask than it is for Django.