There are still sites you cannot reach without using www in domain name. That is DNS configuration problem, but what if you find that your site is indexed with 2 domain names – one with www.yourpage.com and yourpage.com. For search engines, these are two different sites with the same content.
Non WWW to WWW redirection
#Options +FollowSymlinks
RewriteEngine On
RewriteCond %{http_host} ^yoursite.com
RewriteRule ^(.*) http://www.yoursite.com/$1 [R=301,L]
If you have any problem please remove “#” from theĀ first line.
On suphp serversĀ you should remove the lines from .htaccess file that begin with “php_value” and “php_flag”. You will need to add the settings that you want to use to a file named php.ini and upload php.ini into your public_html directory.
You will need to remove php_value and php_flag from ALL .htaccess files you may have
In .htaccess under public_html, add the following:
suPHP_ConfigPath /home/AccountUserName/public_html
<Files php.ini>
order allow,deny
deny from all
</Files>
In php.ini under public_html add the settings that you want to use:
register_globals = On
post_max_size 6M
upload_max_filesize 6M
max_execution_time 90
max_input_time 90
....
To redirect ALL files on your domain use this in your
.htaccess file if you are on a linux web server:
redirectMatch 301 ^(.*)$ http://www.site.net
redirectMatch permanent ^(.*)$ http://www.site.net
You can also use one of these in your .htaccess file:
redirect 301 /index.php http://www.site.net/index.php
redirect permanent /index.php http://www.site.net/index.php
redirectpermanent /index.php http://www.site.net/index.php
If you need to redirect http://site.net to http://www.site.net and you’ve got mod_rewrite enabled on
your server you can put this in your .htaccess file:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^site\.net
RewriteRule ^(.*)$ http://www.site.net/$1 [R=permanent,L]