Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

htaccess question

Comments

  • Registered Users, Registered Users 2 Posts: 7,740 ✭✭✭mneylon




  • Registered Users, Registered Users 2 Posts: 11,987 ✭✭✭✭zAbbo


    trick question, are they two different domains ?

    If not and you just want http://www.mysite.ie to go to http://mysite.ie then do this

    [PHP]

    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^mysite\.ie$
    RewriteRule (.*) http://mysite.ie/$1 [R=301,L]
    RewriteCond %{HTTP_HOST} !^www\.mysite\.ie$
    RewriteRule (.*) http://mysite.ie/$1 [R=301,L]


    [/PHP]

    Bear in mind, I can't think of any good reason why you'd want to redirect this way, normal circumstances you'd want to do the exact opposite for canonical url reasons


  • Registered Users, Registered Users 2 Posts: 21,263 ✭✭✭✭Eoin


    Would this be better suited in the DNS config?


  • Registered Users, Registered Users 2 Posts: 11,987 ✭✭✭✭zAbbo


    eoin_s wrote: »
    Would this be better suited in the DNS config?

    I'm not sure if he already has pages indexed on the www side, this ensures that everything will now point to his choice, as well as notifying SE's correctly.


  • Registered Users, Registered Users 2 Posts: 7,740 ✭✭✭mneylon


    eoin_s wrote: »
    Would this be better suited in the DNS config?
    No

    People expect two A records for a website to exist, so you can't work around this using DNS


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 21,263 ✭✭✭✭Eoin


    blacknight wrote: »
    No

    People expect two A records for a website to exist, so you can't work around this using DNS

    Ah right, I thought you could just set up an alias for this kind of thing.


  • Registered Users, Registered Users 2 Posts: 7,740 ✭✭✭mneylon


    You mean a CNAME? You can, but it won't redirect anything, so it won't achieve what you are looking for


  • Registered Users, Registered Users 2 Posts: 21,263 ✭✭✭✭Eoin


    blacknight wrote: »
    You mean a CNAME? You can, but it won't redirect anything, so it won't achieve what you are looking for

    Sorry, must have been thinking of A records, which I thought was down to DNS configuration


  • Registered Users, Registered Users 2 Posts: 7,740 ✭✭✭mneylon


    eoin_s wrote: »
    Sorry, must have been thinking of A records, which I thought was down to DNS configuration
    It is, but you're confusing DNS with server configs.

    If a user opens http://somerecord they expect some kind of response, so you have to create records at DNS level for both the record you want to display and the one you don't want to display. Moving the URI around is handled by Apache / IIS / your web server config ie. rewriting the URI


  • Registered Users, Registered Users 2 Posts: 21,263 ✭✭✭✭Eoin


    blacknight wrote: »
    It is, but you're confusing DNS with server configs.

    If a user opens http://somerecord they expect some kind of response, so you have to create records at DNS level for both the record you want to display and the one you don't want to display. Moving the URI around is handled by Apache / IIS / your web server config ie. rewriting the URI

    I think that's about time for me to STFU so!


  • Advertisement
  • Closed Accounts Posts: 2,046 ✭✭✭democrates


    I'm in the same boat as eoin, was about to ask for a lilnk explaining this for once and for all, but having intercepted the anticipated google is your friend response, the fruit:
    http://en.wikipedia.org/wiki/Domain_name_system
    and scroll down to "Types of DNS records".

    I'm going to read it.


Advertisement