Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jun 2010
    Location
    Enschede, Netherlands
    Posts
    34
    Thanks
    18
    Thanked 0 Times in 0 Posts

    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

  • #2
    New Coder
    Join Date
    Jun 2010
    Location
    Enschede, Netherlands
    Posts
    34
    Thanks
    18
    Thanked 0 Times in 0 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •