+ Reply to Thread + Post New Thread
Results 1 to 2 of 2

Thread: Please help me with htaccess file

  1. #1
    Noobie
    Join Date
    Apr 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Please help me with htaccess file

    Hi!

    Please, help me setup redirection from ; to ;

    On mydomain I install wordpress and htaccess file looked like:
    ================================================== ==
    Code:
    # BEGIN WordPress
    
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    
    # END WordPress
    ================================================

    In the file begin, I insert this code:

    ================================================
    Code:
    # Always use www in the domain
    # Replace 'mydomain.com' with your domain name
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^([a-z.] )?mydomain\.com$ [NC]
    RewriteCond %{HTTP_HOST} !^www\. [NC]
    RewriteRule .? ; [R=301,L]
    ================================================

    And as result, htaccess file look like:

    ================================================
    Code:
    # Always use www in the domain
    # Replace 'mydomain.com' with your domain name
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^([a-z.] )?mydomain\.com$ [NC]
    RewriteCond %{HTTP_HOST} !^www\. [NC]
    RewriteRule .? ; [R=301,L]
    
    # BEGIN WordPress
    
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    
    # END WordPress
    ================================================

    But it doesn't help. Browser write - "WRONG REDIRECTION"

    Please help me

    Thanks!

    --
    Dmitry

  2. #2
    Noobie
    Join Date
    Apr 2008
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Sorry but I don’t quite understand what you want to do..
    Don’t you have an administration panel to configure that on apache?
    But anyway:

    Code:
    RewriteCond %{HTTP_HOST} \.
    RewriteCond %{HTTP_HOST} !^www\.mydomain\.com [NC]
    RewriteRule (.*) http://www.mydomain.com/$1 [R=301,L]
    RewriteCond %{SERVER_PORT} !^80$
    RewriteRule (.*) http://www.mydomain.com/$1 [R=301,L]
    I think this will do

+ Reply to Thread

Tags for this Thread

Posting Permissions

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