Results 1 to 5 of 5

Thread: Redirecting /home to / not working for multi-domain

  1. #1
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Redirecting /home to / not working for multi-domain

    I've previously configured redirecting the /home.html to / successfully, but I'm able to do it for when you have no URL suffix in the settings, so URLs come out like /home, /destinations, /contact

    I've taken out the .html portion, but because this is a multi-domain, I've had to put two rules in for EACH domain's /home to redirect to / for each domain (they are parked on top of each other, both running on a single Contao install.

    Code:
    	RewriteCond %{THE_REQUEST} ^.*solomonsguide\.com/home
    	RewriteRule ^(.*)home$ http://www.solomonsguide.com/$1 [R=301,L] 
    
    	RewriteCond %{THE_REQUEST} ^.*specialtraveldeals\.co\.za/home
    	RewriteRule ^(.*)home$ http://www.specialtraveldeals.co.za/$1 [R=301,L]
    Can you spot my mistake?

  2. #2
    User MacKP's Avatar
    Join Date
    06-19-09.
    Location
    Duisburg (Germany)
    Posts
    211

    Default Re: Redirecting /home to / not working for multi-domain

    Hi thyon,
    i don't know much about that...
    So here is an other hint:
    Try the Google Sitemap Extension. There you can configure that -> http://www.contao-pool.de/ceris-reader/ ... ap_en.html

    btw: Ceris is a Extension Search. On that Page you can easy search for extensions (much better than the normal ER). And the best thing: there is the output of all languages, so you will find some extension you never found, because there is no engl. translation -> http://www.contao-pool.de/ceris.html
    Ok, its again in german (I will ask for translation on saturday, i promise) but it's not so complicated to search ;-)
    Mediendepot Ruhr
    For real-time chat the (inofficial) Chatroom in IRC:
    -> irc.freenode.net #contao | irc.freenode.net #contao.de

  3. #3
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: Redirecting /home to / not working for multi-domain

    I fixed it myself. I love this forum!! I noticed that i was combining HTTP_HOST and HTTP_REQUEST, which are of course two rule types... Here is the final working version for home (no extension) redirection in a multi-domain environment. Hope this might help you guys at some point.
    Code:
    	RewriteCond %{HTTP_HOST} ^www\.solomonsguide\.com [NC]
    	RewriteCond %{THE_REQUEST} ^.*/home
    	RewriteRule ^(.*)home$ http://www.solomonsguide.com/$1 [R,L] 
    
    	RewriteCond %{HTTP_HOST} ^www\.specialtraveldeals\.co\.za [NC]
    	RewriteCond %{THE_REQUEST} ^.*/home
    	RewriteRule ^(.*)home$ http://www.specialtraveldeals.co.za/$1 [R,L]

  4. #4
    User MacKP's Avatar
    Join Date
    06-19-09.
    Location
    Duisburg (Germany)
    Posts
    211

    Default Re: Redirecting /home to / not working for multi-domain

    Hi thyon,
    thx for sharing ;-)

    regards
    Mediendepot Ruhr
    For real-time chat the (inofficial) Chatroom in IRC:
    -> irc.freenode.net #contao | irc.freenode.net #contao.de

  5. #5
    User
    Join Date
    06-19-09.
    Posts
    417

    Default Re: Redirecting /home to / not working for multi-domain

    Would this also work for you in a multi site environment? I currently use it for all single site installs:

    # REMOVE home.html
    RewriteCond %{QUERY_STRING} =""
    RewriteRule (.*)home\.html$ $1 [R=301,L]

    I also use this on all sites:

    # ENFORCE USE OF WWW
    RewriteCond %{HTTPS} !=on
    RewriteCond %{HTTP_HOST} ^[a-z-]+\.(eu|co\.uk|me\.uk|org\.uk)$ [NC]
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}$1 [R=301,L]

    Does not currently take in to account za! I rarely host those :-)

Bookmarks

Posting Permissions

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