MyBB Community Forums

Full Version: 301 Redirect Help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hiya all.Big Grin

How are you guys? I need a bit of help here. The most I know is to perform this action I need to do a .htaccess file, however, I am unsure how to create this file... Do I basically use a normal txt file and after uploading via my FTP I rename it to .htaccess?

Secondly, the 301(permanent) redirect help I need is to allow my site to automatically show up as http://www.mysite.com/index.php each time a visitor enters my site's address.

In other words, http://mysite.com and http://www.mysite.com will show up as http://www.mysite.com/index.php

Thanks very much, and my apologies for any hassles

Angel
Create normal .txt file, but without .txt extension - .htaccess

RewriteEngine On
RewriteCond %{HTTP_HOST} ^mysite.com [OR]
RewriteCond %{HTTP_HOST} ^www.mysite.com
RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]
Yeah it's just a text file, and as long as its filename is .htaccess on the server, then it is fine.
DamYan Wrote:Create normal .txt file, but without .txt extension - .htaccess

RewriteEngine On
RewriteCond %{HTTP_HOST} ^mysite.com [OR]
RewriteCond %{HTTP_HOST} ^www.mysite.com
RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]

Oh thanks very much guys... one question though before I upload this, would this automatically redirect my link to http://www.mysite.com or basically http://www.mysite.com/index.php?

The reason I am asking this, is I remember reading an article once where the search engines penalise duplicate sites, and http://www.mysite.com will be considered a totally different site from http://mysite.com. Dunno if the same would apply for http://www.mysite.com/index.php

Again, sorry for the trivial questions