> ## Documentation Index
> Fetch the complete documentation index at: https://kb.mochahost.com/llms.txt
> Use this file to discover all available pages before exploring further.

# URL REDIRECTION FOR LINUX PLANS (.htaccess)

## Using PHP Redirect:

1. Edit your web-page using File Manager or FTP Client.

2. Add the following code to your index.php web-page:

` 
 Header( "HTTP/1.1 301 Moved Permanently" ); 
 Header( "Location: http://www.domain.com" ); ?`

PS. Change domain.com to the URL to which you wish to re-direct the website.

## Using .htaccess 301 Redirect:

1. Edit your web-page using File Manager or FTP Client.

2. Add the following to your .htaccess file:

`Options +FollowSymLinks 
 RewriteEngine on 
 RewriteRule (.*) http://www.domain.com/$1 [R=301,L]`

PS. Change domain.com to the URL to which you wish to re-direct the website.

## NON-WWW to WWW Redirect using .htaccess:

1. Edit your web-page using File Manager or FTP Client.

2. Add the following to your .htaccess file:

`Options +FollowSymlinks 
 RewriteEngine on 
 rewritecond %{http\_host} ^domain.com [nc] 
 rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]`

PS. Change domain.com to the URL to which you wish to re-direct the website.
