/home/u764571690/domains/savitrfoundation.com/public_html
Edit: /home/u764571690/domains/savitrfoundation.com/public_html/.htaccess (3583B)
RewriteEngine On
# ✅ 1. Force HTTPS and remove www
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
# ✅ 2. Custom error for missing images
RewriteCond %{REQUEST_FILENAME} .*\.(jpeg|jpg|gif|png)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . /404 [L]
# ✅ 3. Special pages (priority first)
# Redirect .php extension to clean URL
RewriteCond %{THE_REQUEST} /scholarshipportal\.php[\s?] [NC]
RewriteRule ^scholarshipportal\.php$ /scholarshipportal [R=301,L]
RewriteCond %{THE_REQUEST} /scholarshipapply\.php[\s?] [NC]
RewriteRule ^scholarshipapply\.php$ /scholarshipapply [R=301,L]
RewriteCond %{THE_REQUEST} /application\.php[\s?] [NC]
RewriteRule ^application\.php$ /application [R=301,L]
RewriteCond %{THE_REQUEST} /ngo_account_open\.php[\s?] [NC]
RewriteRule ^ngo_account_open\.php$ /ngo_account_open [R=301,L]
RewriteCond %{THE_REQUEST} /scholar/student_login\.php[\s?] [NC]
RewriteRule ^scholar/student_login\.php$ /scholar/student_login [R=301,L]
# Serve pages without extension
RewriteRule ^scholarshipportal/?$ scholarshipportal.php [L]
RewriteRule ^scholarshipapply/?$ scholarshipapply.php [L]
RewriteRule ^application/?$ application.php [L]
RewriteRule ^ngo_account_open/?$ ngo_account_open.php [L]
RewriteRule ^scholar/student_login/?$ scholar/student_login.php [L]
# ✅ 4. Allow .php and .html access without extensions
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+?)/?$ $1.php [L]
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.+?)/?$ $1.html [L]
# ✅ 5. Skip existing files/folders
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# ✅ 6. Fallback to index.php for all other routes
RewriteRule . index.php [L]
# ✅ 7. Sitemap
RewriteRule ^sitemap\.xml?$ sitemap.php [L]
# ✅ 8. Compress assets
AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript
# ✅ 9. Caching headers
ExpiresActive On
ExpiresDefault "now plus 1 hour"
ExpiresByType text/css "now plus 1 month"
ExpiresByType application/javascript "now plus 1 month"
ExpiresByType image/png "now plus 1 year"
ExpiresByType image/jpeg "now plus 1 year"
ExpiresByType image/gif "now plus 1 year"
ExpiresByType image/webp "now plus 1 year"
# ✅ 10. Security headers
Header set X-Content-Type-Options "nosniff"
Header set X-XSS-Protection "1; mode=block"
Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains"
Header set Referrer-Policy "same-origin"
Header set Feature-Policy "geolocation 'self'"
# ✅ 11. PHP session and limits
php_flag display_errors Off
php_value max_execution_time 60
php_value memory_limit 64M
php_value post_max_size 200M
php_value upload_max_filesize 100M
php_value session.gc_maxlifetime 1440
php_value session.save_path "/home/u764571690/domains/savitrfoundation.com/public_html/tmp/sessions"
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/json
AddOutputFilterByType DEFLATE image/svg+xml