Thanks for the reply.
Here is the code I use to force "www" in the .htaccess file:

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.mywebsite.com
RewriteRule (.*) http://www.mywebsite.com/$1 [R=301,L]

Well I tried to put the same code in httpd.conf file but it doesn't
work, I have a "Syntax Error" when restarting apache because the
command "RewriteEngine " is not recognized.

Don't know how to force the "www" with web2py.


On Aug 7, 2:24 pm, Kenneth Lundström <[email protected]>
wrote:
>  > I want to force "www" in front of the url and i modify the .htaccess
> file to do so and now I wonder where to put that file. I tried to put it
> in the "web2py/apps" directory, in the "web2py/apps/views" directory, in
> the "web2py/" directory but none of them works. I'm using apache as
> webserver. Please let me know if you have any idea. Thanks
>
> I think you have to put everything in either httpd.conf or then in the
> virtual conf file you maybe have for every domain name. As wsgi is
> proably used .htaccess is not read.
>
> This is how I have understood it, maybe I m totally wrong.
>
> Kenneth

Reply via email to