Forum

Thread tagged as: Question, Problem

Have you tried removing other lines one by one and testing it? I think you'll need the .php on windows.php though, as that's the name of the original file, isn't it?

Also, I tend to use this to strip the .php from the filenames:

  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME}\.php -f
  RewriteRule ^(.*)$ $1.php
Drew McLellan

Drew McLellan 2638 points
Perch Support

You need to keep the .php in the right hand side of the rewrite.

What result are you getting? An error or a 404 status?

Thanks Martin but unfortunately, that still doesn't resolve the issue.

Hi Drew,

I am getting a 404 error now.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you tried removing everything from your .htaccess and adding it back in bit by bit?

Hi drew,

Yes I have tried that with no success

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok - how can I help?

Thanks for the help but I have now managed to sort it out.

What I did was this...

.htaccess

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

list.html template

<a href="<perch:content id="_page" type="hidden" replace=".php|/" /><perch:content id="slug" type="slug" />">

I will need to add a new .htaccess rule for every page that will be using the list/detail template but does exactly what I need it to do.

Thanks again

Great stuff! Glad you cracked it :)