Results 1 to 2 of 2
  1. #1

    modrewrite without explicit redirecting

    Hi, I have this as my .htaccess

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule !(index.php) [L]

    It works in every way as desired.

    Any url, will show up

    From index.php then I can create php generated websites that take pics, whatever from database.

    However, I got an idea. What about if several domain names use the same index.php and the same database. So, it's like mirrors.

    If I put the same .htaccess in other domain name, I got something unexpected though.

    The url location actually change to

    Also the content of
    PHP Code:
    echo 'Server:' $_SERVER['SERVER_NAME'] . "\n";
    'Host:' $_SERVER['HTTP_HOST'] . "\n";
    'Request:' $_SERVER['REQUEST_URI']; 
    also change to, and /index.php?languageIndicator=lang_ar

    I want an implicit redirect. Not an explicit redirect. To the outside world, people must think that they're indeed accessing and has no way to know that the page they're looking is

    How can I do that?

    Of course, I can always copy index.php to all my domain names. But that's slow.

  2. #2
    Join Date
    Dec 2006
    Charlotte NC
    Rather than redirecting to a URL, you can also redirect to a local file on the server. This will allow redirection without using a specific domain.

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule !(index.php) /var/www/path/to/
    </IfModule> :: Engineered Hosting
    Engineered Hosting solutions including Cloud, Dedicated, Colocation, and Managed Services.

Posting Permissions

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