Let’s asume you want to redirect some specific URI from your site to the homepage. First of all you need to have the mod_rewrite enable, assuming you are using Apache.

Open or create your .htaccess on the project’s root directory and add the following directive:

If your domain name is “www.example.net”, whenever you enter to www.example.net/your-uri you will be redirected to the homepage.

You can redirect to an external URL as well, doing something like this:


Leave a comment