htaccess to Nginx
⚠️ Note: This tool provides basic conversion, complex rules may require manual adjustment. It is recommended to check and test carefully after conversion.
Example:
URL Rewriting
Redirect
Access Control
Cache settings
Gzip compression
🔄 Convert
Apache .htaccess
RewriteEngine On RewriteBase / # Redirect to HTTPS RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # Remove trailing slash RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$1 [L,R=301] # Front controller RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php [L,QSA] # Cache static files <FilesMatch "\.(jpg|jpeg|png|gif|ico|css|js)$"> Header set Cache-Control "max-age=31536000, public" </FilesMatch>
Nginx configuration
Copy
Tools
About
Privacy
Feedback
Guides