How to redirect the Subdomain directory?

Asked

Viewed 591 times

0

I have a domain lostscavenge.com.br and I created a domain for it forum.lostscavenge.com.br that points to the forum Scavenge.forumeiros.com is working right everything beauty, the problem is that if I access lostscavenge.com.br/forum it opens the empty folder of the directory in the browser, and I would like to have it redirected to forum.lostscavenge.com.br

What can I do to make that happen? It’s my hosting, I have general Cpanel access and everything...

1 answer

2

Create a file called index php. and put it at the root of /forum In this file, we will use the command header to redirect as below.

<?php
   header("Location: http://scavenge.forumeiros.com"); 
?>

If you want, you can also do html/javascript.

Create a file index.html, with the following lines:

<script language="javascript">
    window.location.href = "http://scavenge.forumeiros.com";
</script>

But still if you don’t want me to redirect, you can create a file .htaccess within the directory in question, as the example below:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^lostscavenge.com.br/forum$
RewriteRule ^(.*)$ http://scavenge.forumeiros.com$1 [P]

In this, we will be able to maintain the URL, with the external content.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.