Saeid
07-14-2010, 11:13 PM
Dear friends,
I ahd a hard time with my server support, they insist that the rewrite is enabled for my website and the problem is my code.
I want to redirect http://electronicspub.com to http://WWW.electronicspub.com that is having WWW at all time.
I also have links like this and I want them to be more SEO:
http://www.electronicspub.com/articles/articles.item.php?id=16
AND with pages
http://www.electronicspub.com/articles/articles.item.php?id=16&p=1
So I got this code somewhere around but not working. any suggestions?
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.[a-z-]+\.[a-z]{2,6} [NC]
RewriteCond %{HTTP_HOST} ([a-z-]+\.[a-z]{2,6})$ [NC]
RewriteRule ^/(.*)$ http://%1/$1 [R=301,L]
RewriteRule ^article([^/]*)\.html$ /articles/articles.item.php?id=$1 [L]
RewriteRule ^article/([^/]*)/([^/]*)\.html$ /articles/articles.item.php?id=$1&p=$2 [L]
I ahd a hard time with my server support, they insist that the rewrite is enabled for my website and the problem is my code.
I want to redirect http://electronicspub.com to http://WWW.electronicspub.com that is having WWW at all time.
I also have links like this and I want them to be more SEO:
http://www.electronicspub.com/articles/articles.item.php?id=16
AND with pages
http://www.electronicspub.com/articles/articles.item.php?id=16&p=1
So I got this code somewhere around but not working. any suggestions?
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.[a-z-]+\.[a-z]{2,6} [NC]
RewriteCond %{HTTP_HOST} ([a-z-]+\.[a-z]{2,6})$ [NC]
RewriteRule ^/(.*)$ http://%1/$1 [R=301,L]
RewriteRule ^article([^/]*)\.html$ /articles/articles.item.php?id=$1 [L]
RewriteRule ^article/([^/]*)/([^/]*)\.html$ /articles/articles.item.php?id=$1&p=$2 [L]