0

I have http://www.example.com/contact-us.php URL which is working perfectly but if someone put http://www.example.com/contact-us.php/contact-us.php it shows the page with CSS disturbed.

Can we show page not found message to users for this http://www.example.com/contact-us.php/contact-us.php URL? If this page is or is not present.

Update :

My .htacess file - /public_html/.htaccess :

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^(.*[^/])$ http://%{HTTP_HOST}/$1/ [L,R=301]
Rakesh Shetty
  • 4,548
  • 7
  • 40
  • 79

1 Answers1

0

You can create an htaccess file on your server and force trailing slash for all URLs that don't point directly to a file like this (do check whether mod_rewirte is enabled or not):

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !(.*)/$
    #Force Trailing slash
    RewriteRule ^((.*)[^/])$ $1/ [L,R=301]
</IfModule> 
Community
  • 1
  • 1
Nadeem Khan
  • 3,408
  • 1
  • 30
  • 41