.htaccess 998 B

1234567891011121314151617181920212223242526272829303132333435
  1. <IfModule mod_rewrite.c>
  2. # ./public/.htaccess
  3. Options -MultiViews
  4. DirectoryIndex index.php index.html
  5. RewriteEngine On
  6. # Allow your IP through — no redirect
  7. RewriteCond %{REMOTE_ADDR} ^122\.150\.76\.27$
  8. RewriteRule ^dashboard\.php$ - [L]
  9. # Also check X-Forwarded-For if behind a proxy/Cloudflare
  10. RewriteCond %{HTTP:X-Forwarded-For} ^122\.150\.76\.27
  11. RewriteRule ^dashboard\.php$ - [L]
  12. # Everyone else — redirect to homepage
  13. RewriteRule ^dashboard\.php$ https://tasplanning.report/ [R=302,L]
  14. # Don’t rewrite real files/dirs
  15. RewriteCond %{REQUEST_FILENAME} -f [OR]
  16. RewriteCond %{REQUEST_FILENAME} -d
  17. RewriteRule ^ - [L]
  18. # Internally serve extensionless -> .php
  19. RewriteCond %{REQUEST_FILENAME}\.php -f
  20. RewriteRule ^(.+)$ $1.php [L,QSA]
  21. # Redirect visible .php/.html to extensionless (no loops)
  22. RewriteCond %{THE_REQUEST} \s/+(.+)\.php[\s?]
  23. RewriteRule ^ %1 [R=301,L]
  24. RewriteCond %{THE_REQUEST} \s/+(.+)\.html[\s?]
  25. RewriteRule ^ %1 [R=301,L]
  26. </IfModule>