Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

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

    Jul 27, 2013
    Likes Received:
    Trophy Points:
    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. >

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

    i.e. does not redirect at all. It still goes to the original file

    If I use a wildcard redirect then this happens: >

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

    Any advice appreciated.

  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Apr 11, 2011
    Likes Received:
    Trophy Points:
    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.

Share This Page