Welcome to RedirectInfo, the ultimate free resource designed to simplify the process of finding the necessary redirects for various web servers. Whether you're a seasoned developer or a website owner, Redirectinfo is here to assist you in managing your website's redirection needs effortlessly.

At Redirectinfo, we understand the importance of smooth website navigation and ensuring that your visitors always reach the right page. Redirects play a crucial role in achieving this, and that's why we've compiled a comprehensive list of frequently used redirects for both Apache and NGiNX web servers.

With Redirectinfo, you have access to approximately thirty different redirects, ranging from the most commonly used ones to some of the more obscure ones. For popular scenarios, such as redirecting from HTTP to HTTPS for both Apache and NGiNX or redirecting from HTTP-WWW to HTTPS without WWW, our platform provides simple, easy-to-use redirect solutions.

But it doesn't stop there – we go beyond the basics! Our repository also covers rarer redirects that address more complex scenarios, like redirecting pages from URLs with GET parameters to cleaner URLs without GET parameters. These advanced options are crucial for ensuring search engine optimization and improving the user experience on your website.

Using Redirectinfo is a breeze. Our user-friendly interface allows you to quickly search for the redirects you need and access clear, step-by-step instructions on how to implement them correctly. Whether you're a seasoned developer or a website owner without much technical expertise, we've got you covered with detailed explanations that make the process seamless.

List of frequently used redirects in Apache

apache logo

Redirect from HTTP to HTTPS

RewriteCond %{ENV:HTTPS} !on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
apache logo

Redirect from HTTP WWW to HTTPS without WWW

RewriteCond %{HTTP_HOST} ^www.example\.com$ [NC]
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]
apache logo

Redirect from HTTP without WWW to HTTPS with WWW

RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule (.*) https://www.example.com%{REQUEST_URI} [R=301,L]
apache logo

Redirect from a site with WWW to URL without WWW

RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
apache logo

Redirect without WWW to URL with WWW

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
apache logo

Redirect from pages with slash to URL without slash

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+?)/$ /$1 [R=301,NE,L]
apache logo

Redirect from no slash URL to URL with slash

RewriteCond %{REQUEST_URI} !(/$|\.) 
RewriteRule (.*) %{REQUEST_URI}/ [R=301,L]
apache logo

Redirect from multiple slash URLs to one

RewriteCond %{THE_REQUEST} //
RewriteRule ^.*$ $0 [R=301,L,NE]
apache logo

Redirect from one page to another page

Redirect 301 /old.php http://www.domain.com/new.php
apache logo

Redirect all pages in one folder to another folder (redirect folder)

RewriteBase /
RewriteRule ^main-folder/old-folder/(.*)$ /main-folder/new-folder/$1 [L,R=301]
apache logo

Redirect from one domain to another domain

RewriteCond %{HTTP_HOST} domain1.com
RewriteRule (.*) http://domain2.com/$1 [R=301,L]
apache logo

Redirect from a subdomain to the main domain

RewriteCond %{HTTP_HOST} ^teste\.redirectinfo\.com  [NC]
RewriteRule ^(.*) https://www.redirectinfo.com/$1 [L,R=301]
apache logo

Redirect pages from .html to pages without .html

RewriteCond %{REQUEST_URI} ! \.html$
RewriteCond %{REQUEST_URI} ! /$
RewriteRule ^(.*)$ $1.html
apache logo

Redirect pages without .html to pages with .html

RewriteRule (.+)/$ /$1.html [L,R=301]
apache logo

Redirect pages from index.php to slash

RewriteRule ^index.php$ / [QSA,R]
apache logo

Redirect pages from index.html to slash

RewriteRule ^index\.html$ / [R=301,L]
RewriteRule ^(.*)/index\.html$ /$1/ [R=301,L]
apache logo

Redirect pages from index.aspx to slash

RewriteRule ^index.aspx$ / [QSA,R=301]
apache logo

Redirect pages from upper case to lower case

RewriteBase / 
RewriteCond %{REQUEST_URI} ^[^A-Z]*[A-Z].*
RewriteRule ^ ${lc:%{REQUEST_URI}} [L,R=301]
apache logo

Redirect pages from URLs with GET parameters to URLs without GET parameters

RewriteCond %{REQUEST_URI} /page.php
RewriteCond %{QUERY_STRING} ^id=1$
RewriteRule ^(.*)$ http://mysite.com/page/? [R=301,L]

List of frequently used redirects in Nginx

nginx logo

Redirect from HTTP to HTTPS

server {
listen 80 default_server;
server_name example.com;
return 301 https://example.com$request_uri;
}
nginx logo

Redirect from HTTP WWW to HTTPS without WWW

server {
listen 80 default_server;
server_name www.example.com;
return 301 https://example.com$request_uri;
}
nginx logo

Redirect from HTTP without WWW to HTTPS with WWW

server {
listen 80 default_server;
server_name example.com;
return 301 https://www.example.com$request_uri;
}
nginx logo

Redirect from a site with WWW to URL without WWW

if ( $host ~ ^www\.(?.+)$ ) {
return 301 $scheme://$domain$request_uri;
}
nginx logo

Redirect without WWW to URL with WWW

if ( $host !~ ^www\. ) {
return 301 $scheme://www.$host$request_uri;
}
nginx logo

Redirect from no slash URL to URL with slash

rewrite ^/(.*)/$ /$1 permanent;
nginx logo

Redirect from one page to another page

rewrite ^/oldpage$ http://www.example.com/newpage permanent;
nginx logo

Redirect all pages in one folder to another folder (redirect folder)

location ~ ^/images/(.*) {
return 301 /assets/$1;
}
nginx logo

Redirect from one domain to another domain

rewrite ^/(.*)$ http://www.newdomain.com/$1 permanent;
nginx logo

Redirect pages from .html to pages without .html

if ($request_uri ~ ^/(.*)\.html) {
return 301 /$1;
}
nginx logo

Redirect pages from index.php to slash

if ($request_uri ~* "^(.*/)index\.php$") {
return 301 $1;
}
nginx logo

Redirect pages from index.html to slash

if ($request_uri ~* "^(.*/)index\.html$") {
return 301 $1;
}
nginx logo

Redirect pages from index.aspx to slash

if ($request_uri ~* "^(.*/)index\.aspx$") {
return 301 $1;
}

But wait, there's more! Redirectinfo is constantly evolving, and we are dedicated to keeping our repository up-to-date with the latest industry standards and best practices. Our team of experts regularly reviews and adds new redirects to ensure that you have access to the most relevant and efficient solutions.

It's important to note that Redirectinfo is entirely free. We believe that everyone should have access to the tools they need to enhance their website's performance and user experience without any financial burden. No subscriptions, no hidden fees – just a reliable and comprehensive resource at your disposal.

So, whether you're looking to improve your website's security by implementing HTTPS, enhance SEO by removing unnecessary parameters from URLs, or ensure seamless navigation for your visitors, Redirectinfo is here to support you every step of the way.

Join us today and experience the convenience of finding the perfect redirects for your Apache or NGiNX web server. Take advantage of our vast collection of redirects and empower your website with the best redirection practices. Your website's success starts with Redirectinfo – the free resource that simplifies redirects like never before.