using cPanel redirect to 301 URLs with no extension

Discussion in 'Site & Server Administration' started by Pixelrage, Nov 29, 2008.

  1. #1
    Has anyone here used cPanel's "Redirects" feature to 301 redirect URLs that don't have extensions?

    For instance, redirecting "http://www.mysite.com/computers/laptops" to "http://www.mysite.com/laptops"

    I've tried to 301 redirect these the traditional way and they have returned 500 errors, because they have no extension, such as .html or .php. It's probably because of the version of some server-side software I have, like Apache or something else, but I don't know and my server host doesn't, either.
     
    Pixelrage, Nov 29, 2008 IP
  2. kailash

    kailash Well-Known Member

    Messages:
    1,248
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    190
    #2
    kailash, Nov 29, 2008 IP
  3. Pixelrage

    Pixelrage Peon

    Messages:
    5,083
    Likes Received:
    128
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Kailash: thanks... if I were to redirect two URLs with no extension, how would it look? For instance:

    I seem to have tried everything, and it's just showing 500 errors.
     
    Pixelrage, Nov 29, 2008 IP
  4. Cosmic-Host

    Cosmic-Host Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    if you are trying to redirect to a directory you should just direct it right at the index file like kailash showed you. ive tried it before in my cpanel and it worked fine. just play arround with it till you get it. pm me if you dont get it
     
    Cosmic-Host, Nov 29, 2008 IP
  5. dota

    dota Banned

    Messages:
    756
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #5
    if u use wordpress cms.try to download plugin redirect
     
    dota, Nov 29, 2008 IP
  6. kailash

    kailash Well-Known Member

    Messages:
    1,248
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    190
    #6
    The below rule should work:
    redirect 301 /computers/laptops/ http://www.mysite.com/laptops/
    Code (markup):
    I have tested in my site and working fine. I suggest you to check the error logs from cPanel. Probably you will get some details for this error. If there is any invalid rule or line in your .htaccess, you will receive 500 Internal error.

    Kailash
     
    kailash, Nov 29, 2008 IP