Forum

Thread tagged as: Question, Runway

htaccess Runway Upgrade

This is probably a stupid question but I don't have a great understand of regex nor the particular workings of Runway. I have upgraded from Perch to Runway. I had a simple .php rewrite in Perch and am wondering if it will have an effect to Runway...

<IfModule mod_rewrite.c>
RewriteEngine on

# Redirect to PHP if it exists.
# e.g. example.com/foo will display the contents of example.com/foo.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f 
RewriteRule ^(.+)$ $1.php [L,QSA]

# Perch Runway
# RewriteEngine On
RewriteCond %{REQUEST_URI} !^/perch 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /perch/core/runway/start.php [L]

There is redundant code here, I am wonder what is the 'proper' way to order these. I have not converted my perch pages into Runway temple architecture and would rather not at this point. I would like my links to work without the .php extension like they currently do.

Many thanks!

Nicholas Nelson

Nicholas Nelson 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

I think that should work as is. What problem are you experiencing with it?

No problems yet, just concerned that some might show up down the road.

Is there advice for which set of

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

to take out?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Why do you need to take those out?

There are two of each of those lines, is it not redundant?

Drew McLellan

Drew McLellan 2638 points
Perch Support

No, those are conditions on the rules that follow them.