View Full Version : rewrite is not working at all

07-15-2010, 12:13 AM
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:
AND with pages

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]

07-15-2010, 07:34 AM
Well, with some working around I found that I actually need to change the url inside my codes and pages! mod_rewrite is not going to change anything for you unless you change something yourself!!!