Submit Your Article Forum Rules

Results 1 to 4 of 4

Thread: redirect from main URL

  1. #1
    WebProWorld MVP dharrison's Avatar
    Join Date
    May 2005
    Location
    Essex UK
    Posts
    1,334

    redirect from main URL

    Hi all

    I have a problem with one of my recent websites. Basically if you type in www.itsdomainname.com we just get a blank screen. its actual homepage is found at www.itsdomainname.com

    Would a simple 301 redirect remedy this problem? I have had to create an .htaccess file which so far consists of


    SecFilterEngine Off
    SecFilterScanPOST Off
    Is this anything to do with the problem I am experiencing?

    Any help gratefully received. Thanks.
    Deb Harrison
    Essex Web Design | DVH Design Blog
    If I have helped please add to my Reputation

  2. #2
    Senior Member thindenim's Avatar
    Join Date
    Jan 2007
    Posts
    269

    Re: redirect from main URL

    Hi there,

    Do you mean you need requests for domain.com to go to www . domain .com?

    If so, the following should do the trick: -

    RewriteEngine On

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

  3. #3
    WebProWorld MVP dharrison's Avatar
    Join Date
    May 2005
    Location
    Essex UK
    Posts
    1,334

    Re: redirect from main URL

    I wrote that wrong didn't I? I meant www.mydomainname.com needs to redirect to www.mydomainname.com/index.html

    I shall try that thindenim - Thanks.
    Deb Harrison
    Essex Web Design | DVH Design Blog
    If I have helped please add to my Reputation

  4. #4
    WebProWorld MVP wige's Avatar
    Join Date
    Jun 2006
    Posts
    3,138

    Re: redirect from main URL

    The following should work:

    Code:
    RewriteCond %{REQUEST_URI} ^/$
    RewriteRule ^/$ http://www.domain.com/index.html [R=301,L]
    This rule is only activated when "/" (the site root) is requested, and redirects the user to "/index.html". This needs to be fairly specific, because otherwise, the rule could be triggered when subfolders are requested. If you want this rule triggered for all subfolders as well, use the following:

    Code:
    RewriteCond %{REQUEST_URI} ^.*/$
    RewriteRule ^(.*)/$ http://www.domain.com$1/index.html [R=301,L]
    The best way to learn anything, is to question everything.
    WigeDev - Freelance web and software development

Similar Threads

  1. main div not aligning to the top
    By ncriptide in forum Graphics & Design Discussion Forum
    Replies: 3
    Last Post: 01-21-2008, 07:50 PM
  2. 3 SEO Main Principles Only?
    By incrediblehelp in forum Search Engine Optimization Forum
    Replies: 11
    Last Post: 01-19-2007, 08:50 PM
  3. SEO for main income?
    By Steven1976a in forum Search Engine Optimization Forum
    Replies: 22
    Last Post: 11-14-2006, 05:30 PM
  4. zestyfind,look to me the main ones.
    By ruraltrader in forum Internet Security Discussion Forum
    Replies: 7
    Last Post: 07-07-2004, 07:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •