Forum

Thread tagged as: Problem, Hosting, Runway

.htaccess domain rewrites not working in Runway

Hi

I have the following setup in .htaccess so that all our various domain names rewrite to our main domain...

#  RUN PHP v7
    AddType application/x-httpd-php70 .php


# ERROR PAGES
    ErrorDocument 400 /errors/400
    ErrorDocument 403 /errors/403
    ErrorDocument 404 /errors/404
    ErrorDocument 500 /errors/500


# PERCH RUNWAY
    RewriteEngine On
    RewriteCond %{REQUEST_URI} !^/cms 
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule .* /cms/core/runway/start.php [L]


# REDIRECT MULTIPLE DOMAINS TO MAIN DOMAIN
    Options +FollowSymLinks
    RewriteCond %{HTTP_HOST} ^s0undwav3.dns-systems.net$ [OR]
    RewriteCond %{HTTP_HOST} ^www.glenpiggott.co.uk$ [OR]
    RewriteCond %{HTTP_HOST} ^glenpiggott.co.uk$ [OR]
    RewriteCond %{HTTP_HOST} ^www.kingslynnwebdesign.co.uk$ [OR]
    RewriteCond %{HTTP_HOST} ^kingslynnwebdesign.co.uk$ [OR]
    RewriteCond %{HTTP_HOST} ^www.kingslynnwebdesign.com$ [OR]
    RewriteCond %{HTTP_HOST} ^kingslynnwebdesign.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.lynnweb.co.uk$ [OR]
    RewriteCond %{HTTP_HOST} ^lynnweb.co.uk$ [OR]
    RewriteCond %{HTTP_HOST} ^www.sound-wave.co.uk$ [OR]
    RewriteCond %{HTTP_HOST} ^sound-wave.co.uk$ [OR]
    RewriteCond %{HTTP_HOST} ^www.soundwave.marketing$ [OR]
    RewriteCond %{HTTP_HOST} ^soundwave.marketing$ [OR]
    RewriteCond %{HTTP_HOST} ^www.soundwavemarketing.co.uk$ [OR]
    RewriteCond %{HTTP_HOST} ^soundwavemarketing.co.uk$ [OR]
    RewriteCond %{HTTP_HOST} ^www.soundwavemarketing.com$ [OR]
    RewriteCond %{HTTP_HOST} ^soundwavemarketing.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.soundwavemarketing.net$ [OR]
    RewriteCond %{HTTP_HOST} ^soundwavemarketing.net$ [OR]
    RewriteCond %{HTTP_HOST} ^www.soundwavesmarketing.co.uk$ [OR]
    RewriteCond %{HTTP_HOST} ^soundwavesmarketing.co.uk$ [OR]
    RewriteCond %{HTTP_HOST} ^www.soundwavesmarketing.com$ [OR]
    RewriteCond %{HTTP_HOST} ^soundwavesmarketing.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.webdesignkingslynn.co.uk$ [OR]
    RewriteCond %{HTTP_HOST} ^webdesignkingslynn.co.uk$ [OR]
    RewriteCond %{HTTP_HOST} ^www.soundwave.co.uk$
    RewriteRule ^(.*)$ https://soundwave.co.uk/$1 [R=301,L]

...but unfortunately, I'm getting a 404 error whenever I try to go to one of the domains above.

For example www.sound-wave.co.uk should rewrite to soundwave.co.uk and so on.

This method has always worked well for us in standard Perch but not in Runway as I get a 404 error and the URL in the browser address bar is https://soundwave.co.uk/cms/core/runway/start.php.

I'm guessing it's a routeing issue but I'm not sure how to fix it.

Many thanks

Glen

Glen Piggott

Glen Piggott 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

It looks like you need to change the order of the rules.

Of course - thanks Drew. Too many late nights (working!) I can't see the wood from the trees and all that.

I've moved the Runway rewrite rule underneath the domain rewrites and hey presto, all working!

Glen