I recieve the next message after i browse to site.com

500 - Internal Server Error

I recieve my 404 error message after i browse to world wide web.site.com which signifies my website is alive.

How will you create a domain redirection without .htaccess by Django from site.com to world wide web.site.com?

My web addresses.py

     from django.conf.web addresses.defaults import *

     from django.contrib import admin

     admin.autodiscover()

     urlpatterns = designs('',

     # Example:

     # (r'^title /', include('title .foo.urls')),

     (r'^home/', include('index.html')),

     # Uncomment the admin/doc line below and add 'django.contrib.admindocs'

     # to INSTALLED_Applications make it possible for admin documentation:

     (r'^admin/doc/', include('django.contrib.admindocs.urls')),

     (r'^admin/(.*)', admin.site.root),

     )

[edit]

I've the next answer from Djangohosting:

Take away the website proxy for [site.com] and add [site.com] within the aliases portion of the [world wide web.site.com] website.

I'm not completely sure what it really means.

  1. How will you take away the website proxy for site.com?
  2. Where are you able to discover the aliases portion of the website world wide web.site.com?

The 500 Internal Server error is probably triggered with this line:

(r'^home/', include('index.html')),

The include() function is a method to include other URL config files, not static HTML files. You'd need to either serve index.html like a static file in the given URL (/home), or write a view that merely renders the file.

Looking at PREPEND_World wide web setting may help.

I'm not sure whether it solves all of your problems but when for you to do it via django, consider using a middleware

from django.http import HttpResponseRedirect

class WWWRedirectMiddleware(object):

    def process_request(self, request):

        otherwise request.META['HTTP_HOST'].startswith('www.'):

            return HttpResponseRedirect('http://world wide web.mysite.com')

Keep in mind that it should be performed before every other middleware.

According to that one, did not test drive it.

I recieve the next message after i browse to site.com

500 - Internal Server Error

I recieve my 404 error message after i browse to world wide web.site.com which signifies my website is alive.

It's likely the other way round. The 500 message implies that your internet site is active, but giving a mistake. What you need to understand would be that the site.com/world wide web.site.com area of the url actually find which server for connecting to. When your django application will get known as, this part was already completed, so there is no method of doing this from django.

Rather, you need to setup world wide web like a subdomain of site.com making them point the same location. Begin to see the first example here: virtualhosts good examples

UPDATE I simply observed that you simply mentioned that your 404 was turning up, so disregard the first couple of sentences. In either case, the answer would probably be exactly the same. :-)