Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Sep 2007
    Posts
    12

    Default Apache 2.2 rewrite and .htaccess

    Been through hundreds of threads (here and on the web)!

    First off, WHM 11.11.0 cPanel 11.15.0-C17588 running on RHES5 with Apache 2.2/PHP5.2.4

    Apache:
    Code:
    [root@server ~]# httpd -l
    Compiled in modules:
      core.c
      mod_authn_file.c
      mod_authn_default.c
      mod_authz_host.c
      mod_authz_groupfile.c
      mod_authz_user.c
      mod_authz_default.c
      mod_auth_basic.c
      mod_include.c
      mod_filter.c
      mod_log_config.c
      mod_logio.c
      mod_env.c
      mod_expires.c
      mod_headers.c
      mod_unique_id.c
      mod_setenvif.c
      mod_proxy.c
      mod_proxy_connect.c
      mod_proxy_ftp.c
      mod_proxy_http.c
      mod_proxy_ajp.c
      mod_proxy_balancer.c
      mod_ssl.c
      prefork.c
      http_core.c
      mod_mime.c
      mod_status.c
      mod_autoindex.c
      mod_asis.c
      mod_suexec.c
      mod_cgi.c
      mod_negotiation.c
      mod_dir.c
      mod_actions.c
      mod_userdir.c
      mod_alias.c
      mod_rewrite.c
      mod_so.c
    mod_rewrite does appear to be loaded, however, when I attempt to set the following rewrite conditions in a site (.../public_html/.htaccess):
    Code:
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule index/(.*)/(.*)/$ /index.php?$1=$2
    After the addition to the .htaccess file, restarted Apache (just for safe measure), and guess what... NADA -- this simple rewrite rule is NOT working.

    Any suggestions? Is there something in the WHM that blocks the ability for .htaccess for individual sites? Help!

  2. #2
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,788
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Nothing in any error logs?

  3. #3
    Member
    Join Date
    Sep 2007
    Posts
    12

    Default

    Quote Originally Posted by cpanelkenneth View Post
    Nothing in any error logs?
    Nope, nothing at all -- it's like .htaccess is totally unavailable! The page navigates fine, but without the rewrite rule it shows the query string.

  4. #4
    Member
    Join Date
    Sep 2007
    Posts
    12

    Default

    This does work if I enter a URL: http://[mysite]/Google

    Code:
    RewriteRule Google http://www.google.com/? [NC,R,L]

  5. #5
    Member
    Join Date
    Sep 2007
    Posts
    12

    Default

    Solution:

    Code:
    RewriteCond %{QUERY_STRING} ^(.*&)?page=([^&]+)(&.*)?$ [NC]
    RewriteRule ^index\.php$ /tpb/%2? [R,L]
    Seems that Apache 2.2 needs to see the query string and have those extra codes at the end of the RewriteRule

Similar Threads & Tags
Similar threads

  1. WHM/cPanel/Server crashes with .htaccess rewrite rule
    By pauleycreative in forum New User Questions
    Replies: 0
    Last Post: 08-10-2011, 04:13 AM
  2. Need Apache .htaccess rewrite help
    By sneader in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 04-19-2011, 05:45 PM
  3. php4+php5(cgi)+htaccess(rewrite) problem
    By euroxsw in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 05-10-2006, 03:35 AM
  4. rewrite via htaccess
    By Host4u2 in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 11-06-2005, 06:27 PM
  5. .htaccess and rewrite function....
    By craigbrass in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 06-05-2004, 08:03 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube