...

View Full Version : rewrite is not working at all



Saeid
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:
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]

Saeid
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!!!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum