I'm working on a site, colorurl.com, and I need users to be able to type in colorurl.com/00ff00 (or some variation of that), and see the correct page. However, with the naked domain issue, users who type in colorurl.com/somepath will instead be redirected to www.colorurl.com/.
Is there a way to detect this in python, and then redirect the user to where they meant to go (With the www. added?)
EDIT:
Clarification: In my webhost's configuration I have colorurl.com forward to www.colorurl.com. They do not support keeping the path (1and1). I have to detect the previous path and redirect users to it.
- User goes to colorurl.com/path
- User is redirected to www.colorurl.com
- App needs to detect what the path was.
- App sends user to www.colorurl.com/path