Results 1 to 4 of 4
  1. #1

    .htaccess in cPanel


    I have uploaded my .htaccess file to my public_html directory and it is not performing the MOD_REWRITE operations. Do I need to do something in cPanel to ensure .htaccess files are being evaluated?

    I have just moved from hosting my own website to a professional webhost. When I state things like

    RewriteRule ^/([A-Za-z0-9]+)/([A-Za-z0-9]+)/?$ /index.php?type=$1&content=$2 [QSA,L]
    could there be issues related to .htaccess no longer being in the "/" directory?

    Any thoughts?


  2. #2
    Did you use RewriteEngine On and RewriteBase? Do you get errors such as error 500 - server misconfiguration? Give us more input..
    Dyslexics Have More Fnu

  3. #3
    I set RewriteEngine On and I wasn't sure what to do with RewriteBase.

    I ended up solving the problem. My solution was to insert "(.*)" at the beginning of each RewriteRule because my public directory is no longer my Apache root directory. What is publicly accessable to website users is now several directories down from my Apache root directory on my new host. I only needed to accomodate for that.

    Thank you for offering your help. I really appreciate it.


  4. #4
    Problem is that rewrite rules work differently when used via .htaccess and httpd.conf.

    You are now catching every request with (.*). To use your previous rule, your .htaccess would have to look like this:

    RewriteEngine On
    RewriteBase /
    ^([A-Za-z0-9]+)/([A-Za-z0-9]+)/?$ index.php?type=$1&content=$2 [QSA,L]
    Dyslexics Have More Fnu

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts