[How to] Redirect URL in WordPress


In this tutorial, I will walk you through redirecting a URL in WordPress without using any plugins.

You can open a Terminal or Command Prompt window and do the following:

$cd to /var/www/html
$ls -loa
$sudo nano .htaccess
Append to the end of file “Redirect 301 old-URL new-URL”
Save the file and exit

$sudo service apache2 restart

This tutorial redirects a URL in WordPress without a plugin by adding a Redirect 301 rule to the site's .htaccess file on an Apache server. A 301 tells browsers and search engines that the move is permanent.

Editing .htaccess directly is lightweight and avoids extra plugins, but keep a backup, since a syntax mistake there can take the site down until it is corrected.

Comments

Popular posts from this blog

[Solved] Error: No such keg: /usr/local/Cellar/gcc

[How To] Unfollow Non-followers on Instagram