#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2008
    Location
    Cochin, India
    Posts
    99
    Rep Power
    6

    Setting redirection into backward folder


    Hi,
    I have a domain say http://www.mydomain.com
    i have the .htaccess file in the root folder to redirect all the calls into index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .* index.php

    Now, One of the partner website needs to load the same content of what we have in the http://www.mydomain.com,
    and they need to call they URL as
    http://www.mydomain.com/partnerwebsite

    Of course we have some programing to manage the theme and listing based on the full domain Url.


    How can i set that?

    I have tried in this way

    - I have added the following entry to the httpd-vhosts.conf

    <VirtualHost *>
    DocumentRoot "H:/xampp/htdocs/mydomainrootfolder"
    ServerName mydomain.local/partnerwebsite
    <Directory "H:/xampp/htdocs/mydomainrootfolder">
    Order allow,deny
    Allow from all
    </Directory>
    </VirtualHost>

    It is redirected to the correct folder
    but the issue there is, since i have
    1) the .htaccess entry as i mentioned above
    2) the folder or file called 'partnerwebsite' doesn't exists in root folder
    it gives an error from the application


    I need to be execute the same index.php file from the root folder as such as the root folder is at 'partnerwebsite' folder

    Please help

    Regards,
    Anees
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    ServerName mydomain.local/partnerwebsite
    This part isn't valid. You can't put paths into a ServerName or ServerAlias. You can't create a vhost for a subdirectory.

    If the partnerwebsite directory doesn't exist in your webroot, it seems like the .htaccess rule should be catching the request and routing it through index.php already?
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

IMN logo majestic logo threadwatch logo seochat tools logo