htaccess question

Discussion in 'Programming' started by maxbear, Jul 29, 2007.

  1. #1
    Hello,

    The following code state a domain myblog.com. Is it possible not to specify on any domain? I want all domains, instead of only myblog.com. Thanks.

    Options +Indexes
    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^myblog\.com
    RewriteRule ^(.*)$ http://www.myblog.com/$1 [R=permanent,L]

    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !(.*)/$
    RewriteRule ^(.*)$ http://www.myblog.com/$1/ [L,R=301]
     
    maxbear, Jul 29, 2007 IP
  2. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #2
    Change this line:
    RewriteCond %{HTTP_HOST} ^myblog\.com
    Code (markup):
    To:
    RewriteCond %{HTTP_HOST} !^www\.myblog\.com [NC]
    Code (markup):
     
    krt, Jul 29, 2007 IP