.htaccess 301 Redirect Generator
Create Apache .htaccess rules for WWW, HTTPS and individual URL redirects.
Force redirect to HTTPS
Domain preference
RewriteEngine On
# Redirect to HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Remove www
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ https://%1%{REQUEST_URI} [L,R=301]
# Custom 301 redirects
Redirect 301 /eski-sayfa /yeni-sayfa
Redirect 301 /blog/eski https://clou.tr/blog/yeni.htaccess redirects
.htaccess files are most commonly used to create 301 (permanent) redirects that move visitors and search engines to the right address. This tool prepares the most commonly needed rules for you.
- Force HTTPS: Moves all traffic to a secure connection
- www / non-www: Sets a single preferred domain and prevents duplicate content
- 301 redirect: Preserves the SEO value of moved pages
Add the generated rules to the .htaccess file in your site's root directory. A valid SSL certificate is required for the HTTPS redirect.
Frequently Asked Questions
Related Tools
SMTP Test Tool
Validate your port and encryption settings, then generate the SMTP test commands and DNS checklist to run on your server.
Strong Password Generator
Generate strong, random and hard-to-crack passwords locally in your browser.
Hash (SHA) Generator
Instantly compute the SHA-1, SHA-256, SHA-384 and SHA-512 digests of your text in the browser.
Fast, secure, Turkey-based hosting
Move your website to Clou.TR with NVMe SSD, free SSL and a 99.9% uptime guarantee.