Thread tagged as: Question, Problem, Error

.htaccess + perch

Hi, I am using some Rewrite rules on htaccess on this website and they just worked fine

ErrorDocument 404 /404.php

Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC]

#RewriteRule / index.php?page=$1&%{QUERY_STRING} [NC,L]
RewriteRule works index.php?cont=works&%{QUERY_STRING} [NC,L]
RewriteRule editorial index.php?cont=editorial&%{QUERY_STRING} [NC,L]
RewriteRule curatorial index.php?cont=curatorial&%{QUERY_STRING} [NC,L]
RewriteRule educational index.php?cont=educational&%{QUERY_STRING} [NC,L]
RewriteRule info info.php [NC,L]

RewriteCond %{REQUEST_URI} !(info.php|o.php|perch)$ [NC]

the problem comes when I copy this line at the bottom to integrate 'remove php extension' on blog posts (o.php) and visit /perch/.

RewriteRule ^([a-zA-Z0-9-/]+)$ /o.php?s=$1 [L]

it gives me this error:

Warning: Invalid argument supplied for foreach() in /home/raulserrano/ on line 40

Does anyone know how I could integrate that rule with my current .htaccess?

Raul Serrano

Raul Serrano 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you looked to see what line 40 in your page is? That might give you some clues.

I don't think this really sounds like a Perch issue.