Skip to content

Simple yet powerful WordPress .htaccess redirect codes.

Notifications You must be signed in to change notification settings

quickfever/htaccess

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

  • 👋 Hi, I’m @quickfgit
  • 👀 I’m interested in Technology
  • 🌱 I’m currently learning line and graph
  • 📫 How to reach me ohh no

Redirect www to non-www

Usage

  1. Trim www from your domain name.
  2. Redirect www to non-www to fix Google Canonical issues.

Add this piece of code to your .htaccess file.

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Redirect HTTP_HOST to HTTP_HOST

Add this piece of code to your .htaccess file. RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

About

Simple yet powerful WordPress .htaccess redirect codes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages