Forum

Thread tagged as: Problem, Configuration, Runway

Perch Runway SSL 404 Error

I am running a fresh copy of the latest Perch Runway system on a blank hosting environment using the default .htaccess rewrite rules from the documentation in the root of the web server along with the /perch folder (renamed /admin). I have an SSL certificate loaded onto my site for https:// requests and have set define('PERCH_SSL', true); in the config to force it for all pages. When I did so, now the control panel page throws a 404 error. Is this a mod rewrite conflict because my .htaccess file is in the root affecting the child /perch folder files?

Kevin Wolff

Kevin Wolff 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

We're actually deprecating PERCH_SSL - it was intended for sites in mixed environments, which doesn't really happen any more.

Why are you using it here?

Ah, that makes sense. I was attempting to force Perch Runway to run all pages using https:// and the documentation suggested that config definition along with individual Perch tags to force a certain page. My project is an e-commerce site, so I'd like the entire thing to be run using the SSL cert. Should I just use the root htaccess file?

Drew McLellan

Drew McLellan 2638 points
Perch Support

You should be configuring this at your web server, really. Runway doesn't need to know whether it's https or not.

So I have removed the deprecated definition from config and my hosting provider suggested the following for my .htaccess file at the public root outside the /admin folder. The browser rewrites the https:// and www. but I get a Perch 404 when attempting to access site.com/admin or site.com/admin/index.php.

RewriteEngine On
# SSL
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# WWW
RewriteCond %{HTTP_HOST} ^interfitphoto.com
RewriteRule (.*) https://www.interfitphoto.com/$1 [R=301,L]
# CMS
RewriteCond %{REQUEST_URI} !^/admin
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* /admin/core/runway/start.php [L]
Drew McLellan

Drew McLellan 2638 points
Perch Support

So was it working before you did this? If your request isn't even getting as far as Runway, this is a bit outside of my wheelhouse.