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.

Change format of cPanel Redirects to avoid 404 pages?

Discussion in 'General Discussion' started by sm9, Apr 28, 2010.

  1. sm9

    sm9 Active Member

    Joined:
    Oct 10, 2009
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    Hi there,

    When using the Redirects section of cPanel, is it possible to change the format that the redirects are created in? This is because I keep getting 404 pages for the way cPanel creates them (maybe because it's clashing with other rules that I need for my CMS?), but I know that my manual method works fine.

    Here's what cPanel is giving me 404's for via the Redirects section:

    Code:
    RewriteCond %{HTTP_HOST} ^.*$
    RewriteRule ^test$ "http\:\/\/www\.mywebsite\.org\.uk\/about\/test\/" [R=301,L]
    
    And here's the manual method that works fine when I enter this into a .htaccess file manually (which also displays via the Redirects section, by the way):

    Code:
    Redirect 301 /test http://www.mywebsite.org.uk/about/test/
    
    My client would like the ability to add their own redirects so if they could do so via this Redirects GUI, it'd be great.

    Thanks,

    Stephen
     
  2. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Does the mod_rewrite entry setup via cPanel work after ensuring there are no other conflicting rewrite rules?

    What settings and options were used for initial setup when configuring the redirect via cPanel? I would like to try to reproduce the difficulty on a clean test system.
     
  3. sm9

    sm9 Active Member

    Joined:
    Oct 10, 2009
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    Hi Don,

    I'm guessing it's the existing rules I have in place that are causing the issue here:

    Code:
    RewriteEngine On
    
    # Remove Index.php from URL for CMS
    RewriteCond $1 !^index\.php/
    RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]
    
    I've since found a nice module for the CMS that allows redirects to be made via that so this is no longer an issue for me, but just posting up the above for info and interest.

    Thanks,

    Stephen
     
Loading...

Share This Page