Redirect domain name to a specific page

by Lucien   Last Updated April 11, 2019 17:04 PM

I have theses domain names installed:

  • Main domain name: www.example.com
  • Others domains:
    • www.example.org
    • www.example.fr
    • www.animals.example

I first made a rule on my .htaccess to redirect all traffic from theses domain names into my main domain www.example.com with the HTTPS:

RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://www.example.com/$1 [R=301,L]

I have then a rule to rewrite my URL like that :

RewriteRule   ^([a-z]{2})-([0-9]+)-(.*)\.html$   index.php?lang=$1&menu=$2  [L]

The structure of my URLs are: https://www.example.com/fr-10-my-page-about-animals.html I need to promote this page on internet, but the URL is pretty difficult to remember and my main domain name: www.example.com is too generic.

I do have 2 very specific and important pages on my website that I want to promote though an easy to remember and short URL, so I bought the domain name: www.animals.example. I want that my visitors arrive on this page https://www.example.com/fr-10-my-page-about-animals.html with this (easy to remember) URL: ww.animals.example.

What is the best practice regarding Search Engines (Google)? Is it a good idea, good practice to do it?

Should I make a 301 redirection, so I can give to people this www.animals.example URL to visit my page, they will be then redirected and their browser will display https://www.example.com/fr-10-my-page-about-animals.html

Or is there a possibility to print www.animals.example as the URL on the browser when https://www.example.com/fr-10-my-page-about-animals.html is called?

How can I implement this in the most Google Friendly way?



Answers 1


Well you can redirect www.animal.example website to that example.com/whatever by using js (JavaScript) Or PHP too. It will not affect anything regarding to SEO (Search engine optimization) JavaScript:

<script>windows.location = "https://example.com/whatever"; </script>

PHP:

<?php
/*
Made with love.
Follow on twitter: https://twitter.com/salman_0x01
*/
header(" Location: https://example.com/whatever");
?>
Salman Khan
Salman Khan
April 11, 2019 09:58 AM

Related Questions


Updated February 18, 2019 00:04 AM

Updated May 17, 2018 19:04 PM

Updated March 12, 2016 07:01 AM

Updated June 13, 2015 00:01 AM

Updated January 07, 2017 08:01 AM