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.

.htaccess rewrite rule giving 404 not found on live server

Discussion in 'General Discussion' started by iToke, Dec 4, 2011.

  1. iToke

    iToke Active Member

    Joined:
    Sep 23, 2010
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    Hi,
    I've created my first .htaccess file to create a folder from the query string e.g. -
    'event-service-listings.php?category=events' gets changed to -
    'event-service-listings/events/'
    It works perfectly on my localhost, but when I uploaded it to the dedicated server using a temp url - Corporate Event Services (click on one of the search by category headers) I get a 404 page not found error!

    the code used in .htaccess (uploaded to public_html) -

    Code:
    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{QUERY_STRING} ^(.*)$
    RewriteRule ^event-service-listings/(.*)/$ event-service-listings.php?category=$1&%1
    I've got no experience using mod_rewrite and don't know where to start looking to fix the issue.
    Any ideas.
    Many thanks
     
  2. iToke

    iToke Active Member

    Joined:
    Sep 23, 2010
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    I've just read this at docs.cpanel.net -
    "Sites that use mod_rewrite and other directives in their .htaccess files will not work as expected when viewed using mod_userdir URLs. "

    Do you think this is the cause of my problem, the URL with the issue is - 79.170.43.172/~cesco

    thanks
     
  3. quietFinn

    quietFinn Well-Known Member

    Joined:
    Feb 4, 2006
    Messages:
    998
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    Yes it definitely is.
     
Loading...

Share This Page