www.webdeveloper.com
Results 1 to 3 of 3

Thread: htaccess question

  1. #1
    Join Date
    May 2004
    Posts
    129

    htaccess question

    hello ... I have a non-JS question, but nevertheless I figure I'll ask ...


    I have a server:
    -- root_directory
    ---- a_domain.com // a sub directory with a domain name


    my server is set up ( via my webhost admin control panel ) to direct:
    - a_domain.com --> root_directory/a_domain.com
    - a_domain.eu --> root_directory/a_domain.com


    every thing works fine, but...

    now I want any www.a_domain.eu requests to re-direct to www.a_domain.com.

    I have spent about an hour trying various htaccess methods but I have not been successful.

    any thoughts?

    thanks,
    Shannon

  2. #2
    Join Date
    May 2004
    Location
    Manhattan NY
    Posts
    6,028
    You've already tried 301 rewrite/ redirect?

  3. #3
    Join Date
    May 2004
    Posts
    129
    I created a new directory: my_domain.eu such that my directory structure looks like:
    -- root_directory
    ---- my_domain.com // a sub directory with a domain name
    ---- my_domain.eu // a sub directory with a domain name

    I re-set my server ( via my webhost admin control panel ) to direct:
    - my_domain.com --> root_directory/my_domain.com
    - my_domain.eu --> root_directory/my_domain.eu


    inside the sub directory my_domain.eu I placed an htaccess:
    Code:
    #Options +FollowSymlinks
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^my_domain.eu$ [OR]
    RewriteCond %{HTTP_HOST} ^www.my_domain.eu$
    RewriteRule (.*)$ http://www.my_domain.com/$1 [R=301,L]
    and it works;





    ideally, I would like to NOT have had to create sub directory my_domain.eu, but I was unsuccessful at getting the re-direct to work from root_directory ... no big deal though.

    Shannon

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles