Advertisement
infologica

Apache - route all requests to a single PHP file

Nov 5th, 2023 (edited)
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | Cybersecurity | 0 0
  1. /etc/apache2/apache2.conf
  2. <Directory /var/www/>
  3. AllowOverride All
  4. </Directory>
  5.  
  6. /var/www/html/.htaccess
  7. RewriteEngine On
  8. RewriteBase /
  9. RewriteCond %{REQUEST_FILENAME} !-f
  10. RewriteCond %{REQUEST_FILENAME} !-d
  11. RewriteRule ^(.*)$ index.php [QSA,L]
  12.  
  13. [ cPanel ]
  14.  
  15. .htaccess
  16.  
  17. # php -- BEGIN cPanel-generated handler, do not edit
  18. # Set the “ea-php81” package as the default “PHP” programming language.
  19. <IfModule mime_module>
  20. AddHandler application/x-httpd-ea-php81 .php .php8 .phtml
  21. </IfModule>
  22. # php -- END cPanel-generated handler, do not edit
  23.  
  24.  
  25.  
  26. RewriteEngine On
  27. RewriteBase /
  28. RewriteCond %{REQUEST_FILENAME} !-f
  29. RewriteCond %{REQUEST_FILENAME} !-d
  30. RewriteRule ^(.*)$ index.php [QSA,L]
  31.  
  32. # php -- BEGIN cPanel-generated handler, do not edit
  33. # Set the “ea-php81” package as the default “PHP” programming language.
  34. <IfModule mime_module>
  35. AddHandler application/x-httpd-ea-php81 .php .php8 .phtml
  36. </IfModule>
  37. # php -- END cPanel-generated handler, do not edit
  38.  
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement