Jump to content

Error page not processed if missing is folder without trailing /


dbx

Recommended Posts

The error page I have added to my site works fine unless I try call a folder than does not exist and don't include a trailing /

 

It's a PHP error page and the browser simply displays the unprocessed code.

 

I have "RewriteBase / " in my .htaccess file which I thought appended a / to the url if it was missing.

 

My hosting company said it's a scripting issue, but I doubt that considering the page is displayed for regular pages and if I include the /

 

Any ideas?

 

Thanks.

 

 

To force a trailing slash at the end of the url use the following rewrite rule:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://www.yoursite.com/$1/ [R=301,L]

Change http://www.yoursite.com to your actual sites address.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.