The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Redirect all files in a directory

Discussion in 'General Discussion' started by Kerrya, Dec 15, 2014.

  1. Kerrya

    Kerrya Registered

    Joined:
    Jul 27, 2013
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    I'm having a problem with 301 redirects.

    I have a sub-directory that contains a forum that is no longer used. I want to redirect all hits on that directory back to the main root of the site.

    i.e. abc.com/my-directory/ > abc.com

    this only seems to work on the directory but not on the files in the directory.

    i.e. abc.com/my-directory/my-file.html does not redirect at all. It still goes to the original file

    If I use a wildcard redirect then this happens:

    abc.com/my-directory/my-file.html > abc.com/my-file.html

    Is there a way to redirect all links to that directory regardless of what file is specified?

    Any advice appreciated.

    Kerry
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    You will likely need to implement some custom Mod_Rewrite rules in order to redirect those requests. You may want to post to the support forums of the previous script you were using to see what type of rules others might have utilized.

    Thank you.
     
Loading...

Share This Page