WebFaction
Community site: login faq

Hi,

I have site running on Flask + Apache mod_wsgi. I need to redirect users from demo.abc.com to www.demo.abc.com I have written the following

.htaccess code.

< IfModule mod_rewrite.c>
< IfModule mod_negotiation.c>
    Options -MultiViews
< /IfModule>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^demo.abc.com$
RewriteRule (.*) http://www.demo.abc.com/$1 [R=301,L]
</IfModule>

With the above code user is redirected from demo.abc.com to www.demo.abc.com/index.py

I hope index.py is suffixed automatically because of the WSGIScriptAlias in the following httpd.conf file.

httpd.conf file (Partial)

WSGIDaemonProcess oh_demo processes=2 threads=12 python-path=/home/arulkumar/webapps/oh_demo/lib/python3.4
WSGIProcessGroup oh_demo
WSGIRestrictEmbedded On
WSGILazyInitialization On

WSGIPythonPath /home/arulkumar/webapps/oh_demo/htdocs/
WSGIScriptAlias / /home/arulkumar/webapps/oh_demo/htdocs/index.py

WSGIScriptAlias /static /home/arulkumar/webapps/oh_demo/core/static

< Directory /home/arulkumar/webapps/oh_demo/htdocs>
Options +ExecCGI
AddHandler wsgi-script .py
RewriteEngine on
RewriteBase /
AllowOverride All
WSGIScriptReloading On
< /Directory>

Can help me out fixing this issue ?

asked 17 Jun '16, 07:09

arulkumar
112
accept rate: 0%


Hello,

You can redirect the domain name as described in our documentation.

Basically, you will need to create another site for the naked domain, attach a Static/CGI/PHP application and put your rewrite rules there.

permanent link

answered 17 Jun '16, 11:48

dimitari
2215
accept rate: 36%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×337
×76
×75
×44

question asked: 17 Jun '16, 07:09

question was seen: 1,723 times

last updated: 17 Jun '16, 11:48

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM