Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-14-2010, 11:13 PM   PM User | #1
Saeid
New Coder

 
Join Date: Jun 2010
Location: Enschede, Netherlands
Posts: 34
Thanks: 18
Thanked 0 Times in 0 Posts
Saeid is an unknown quantity at this point
rewrite is not working at all

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/articl...item.php?id=16
AND with pages
http://www.electronicspub.com/articl....php?id=16&p=1

So I got this code somewhere around but not working. any suggestions?
Code:
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]
__________________
ELECTRONICSPUB.COM
All about electronics and hardware
Saeid is offline   Reply With Quote
Old 07-15-2010, 06:34 AM   PM User | #2
Saeid
New Coder

 
Join Date: Jun 2010
Location: Enschede, Netherlands
Posts: 34
Thanks: 18
Thanked 0 Times in 0 Posts
Saeid is an unknown quantity at this point
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!!!
__________________
ELECTRONICSPUB.COM
All about electronics and hardware
Saeid is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:42 AM.


Advertisement
Log in to turn off these ads.