How do only a few references (without .php) and the remaining 404 make available at .htaccess?



  • There are three references to how to make a transition in a .htaccess. site.ru/donate.php character site.ru/donate ? Same for the other two references.

    site.ru/privacy

    site.ru/howtobuy

    If the user enters a non-existent address (except for these 3 references), it will be dropped to 404 pages. Thank you.



  • RewriteEngine on 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteCond %{REQUEST_FILENAME}\.php -f 
    RewriteRule ^(.*)$ $1.php
    
    ErrorDocument 404 /404
    

    Try the code, work hard.


Log in to reply
 

Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2