Jump to content

Error page not processed if missing is folder without trailing /


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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.