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?
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 ;-)
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]
Re: Redirecting /home to / not working for multi-domain
Hi thyon,
thx for sharing ;-)
regards
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 :-)