Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Feb 2011
    Posts
    1

    Default help with mod_rewrite.

    I am posting it here after spending over a day and reading apache and docs on the web.

    I am trying to test apache’s rewrite rules directive on. I have sub directory under public_html called wm, which contains test.php and a very simple .htaccess files; nothing fancy.

    # start .htaccess

    RewriteEngine On
    RewriteRule ^wm(/)?$ test.php [NC,L]

    # end .htaccess

    // start test.php
    <?php
    echo ‘hello world’;
    ?>
    // end test.php

    I am expecting it to execute test.php and display ‘hello world’ when I type www.mydomain.co/wm. Instead, I get internet server error message. Also, when I try Business profile for mydomain.co provided by Network Solutions, I still get internal server error.

    I can’t quite put my finger on what’s missing.

    Alex

  2. #2
    Member
    Join Date
    Jan 2011
    Posts
    505
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: help with mod_rewrite.

    Hi Alex.

    It may be an issue with permission or ownership. Please posy your apache error logs which can be found with the help of the command tail -f /usr/local/apache/logs/error_log

  3. #3
    Member raghunath's Avatar
    Join Date
    Feb 2011
    Posts
    12

    Default Re: help with mod_rewrite.

    You can try this
    ------------------------------------------------------------
    RewriteEngine On
    RewriteCond %{HTTP_HOST}%{REQUEST_URI} ^domainname.com/$ [NC,OR]
    RewriteCond %{HTTP_HOST}%{REQUEST_URI} ^www.domainname.com/$ [NC]
    RewriteRule ^(.*)$ http://www.domainname.com/test.php/$1 [r=301,nc]
    ------------------------------------------------------------

    OR
    Code:
    # Redirect old file path to new file path
    RewriteEngine On
    Redirect /olddirectory/oldfile.html http://domainame.com/newdirectory/newfile.html

Similar Threads & Tags
Similar threads

  1. Mod_Rewrite
    By faison in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 11-30-2009, 05:16 PM
  2. help: mod_rewrite
    By marquis_ce in forum New User Questions
    Replies: 1
    Last Post: 06-18-2008, 03:00 PM
  3. mod_rewrite
    By Cityhost in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 02-02-2005, 03:26 AM
  4. mod_rewrite
    By elleryjh in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 01-23-2005, 09:06 AM
  5. mod_rewrite
    By cguimont in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 10-05-2004, 07:50 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube