General Guide to .htaccess

[quote name=‘Raj’]Thank you! Thank you!..Thank you soo much…You are gem…[/QUOTE]



What code did you insert into that file to get it to point to www ?

Below is mine, can anyone see any problems with it? Just curios if all is ok… I do have the seo addon activated.



DirectoryIndex index.html index.php





RewriteEngine on

Some hostings require RewriteBase to be uncommented

Example:

Your store url is [url]http://www.yourcompany.com/store/cart[/url]

So “RewriteBase” should be:

RewriteBase /store/cart

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !.(png|gif|ico|swf|jpe?g|js|css)$

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . index.php?sef_rewrite=1 [L,QSA]



RewriteCond %{REQUEST_FILENAME} ./catalog/.

RewriteCond %{REQUEST_FILENAME} -d

RewriteCond %{REQUEST_FILENAME}/index.html !-f

RewriteRule . index.php?sef_rewrite=1 [L,QSA]



I changed



// Host and directory where software is installed on no-secure server

$config[‘http_host’] = ‘domain.com’;

$config[‘http_path’] = ‘’;



// Host and directory where software is installed on secure server

$config[‘https_host’] = ‘domain.com’;

$config[‘https_path’] = ‘’;





TO



// Host and directory where software is installed on no-secure server

$config[‘http_host’] = ‘www.domain.com’;

$config[‘http_path’] = ‘’;



// Host and directory where software is installed on secure server

$config[‘https_host’] = ‘www.domain.com’;

$config[‘https_path’] = ‘’;

i added this to .htaccess

DirectoryIndex index.html index.php





RewriteEngine on

Some hostings require RewriteBase to be uncommented

Example:

Your store url is [url]http://www.yourcompany.com/store/cart[/url]

So “RewriteBase” should be:

RewriteBase /store/cart

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !.(png|gif|ico|swf|jpe?g|js|css)$

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . index.php?sef_rewrite=1 [L,QSA]



RewriteCond %{REQUEST_FILENAME} ./catalog/.

RewriteCond %{REQUEST_FILENAME} -d

RewriteCond %{REQUEST_FILENAME}/index.html !-f

RewriteRule . index.php?sef_rewrite=1 [L,QSA]











################## block country ##################

CHINA



order deny,allow

deny from 58.14.0.0/15

deny from 58.16.0.0/13

etc…

################## Other Countries ##################

deny from 216.65.57.0/16 #Kuwait

deny from 72.32.68.153 #USA

deny from 95.131.90.35 #Russia

################## SPAM/HACKER ##################

deny from 78.110.50.112

deny from 200.150.79.18

deny from 75.126.127.34

deny from 122.201.102.68

Guess I am going to have to add that China block too. This has been going on most of the day.

We just moved to a new server and already getting this as of this morning.

But there is such a wide range of IP addresses.











UPDATE:

For anyone else looking to block the entire dang country and then some

[url]http://www.parkansky.com/china.htm[/url]

Here is the whole list of the top spamers: [url]http://www.martfox.com/htaccess-block-country.php[/url]

Indiy: Thank You, Your list worked better to stop these thugs.