Results 1 to 2 of 2
  1. #1

    Subdomain redirect problem... site not resolved?

    I put an .htaccess file in a directory with the contents:

    Redirect /

    When I go to http:/

    It goes to

    WHY does the "~username/test/" get stuck on the redirected URL? Is this because my domain has not resovled yet??

  2. #2
    Join Date
    Dec 2003
    Sunny So. Calif.
    Looks like you want all URI requests ending with /~username/test to be 'redirected' to the main docroot's test.php file. Right?

    Redirect method:
    Redirect /~username/test

    Using mod_rewrite method:

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteMap lowercase int:tolower

    RewriteCond %{REQUEST_URI} ^/~username/test
    RewriteRule (.*) [R]

    This will 'redirect' to the docroot/test.php file, and will change the browser's displayed URL.

    It also is case insensitive (lowercase int:tolower), and only gets processed if you have mod_rewrite active.

    Using rewrite can be more flexible, by adding additional RewriteCond statements to make sure the RewriteRule is only applied if all conditions are met.
    Last edited by jamesyeeoc; 07-08-2005 at 02:47 AM.

Posting Permissions

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