1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

.htaccess Help needed

Discussion in 'Site & Server Administration' started by afhayati, Jul 24, 2010.

  1. #1
    Hi

    I want to redirect a url in htaccess file. here's what I want to do:

    changing:
    to:
    (means I want to remove category ID)


    would you help me plase to do that?


    P.S.
    I have some traffic by some urls in the 1st format. Don't want to loose them. In my site I can use the 2nd format, but want to redirect the 1st one to the new url first.
     
    afhayati, Jul 24, 2010 IP
  2. ForumSeeder

    ForumSeeder Peon

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    A 301 redirect lets search engines know where you've moved your page to
    it basically says "hey... search engine, I'm over here now, so can you let the PR flow this way and don't penalise me since it's not duplicate content"

    The modern way of doind a 301 redirect is to do it with your htaccess file
    (this will only work with apache servers)


    There are lots other ways of doing a 301 redirect, have a look here:

    301 redirects
     
    ForumSeeder, Jul 24, 2010 IP
  3. afhayati

    afhayati Active Member

    Messages:
    154
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #3
    Thanks "ForumSeeder", but I'm using a htaccess file to redirect many urls. I Just think one url is not fine, although I have traffic by it. so I want to remove an ID in urls because it's not necessary.
    I use this:

    RewriteRule ^articles/?/([0-9]+)/?/([_A-Za-z0-9-]+)/?$ list.php?id=$1 [L]

    Now, what if I remove the ?/([0-9]+)/? (this is category ID)

    So the new one will be:
    RewriteRule ^articles/([_A-Za-z0-9-]+)$ list.php?category=$1 [L]

    My question is how to change urls in 1st format to 2nd one?

    Is it work fine for this?
     
    afhayati, Jul 24, 2010 IP