Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    Regular Coder
    Join Date
    Mar 2004
    Thanked 0 Times in 0 Posts

    Add-on domain modrewrite headache

    Hey there. I have a site at mydomain.com/folder, figured it would be easy to use an addon domain addon.com to send everyone to the same folder, and now i'm in modrewrite hell

    because all my links are in the from src/href=/folder/otherfolders/file.txt i got links such as addon.com/folder/otherfolders... which needed to be just addon.com/otherfolders... .

    using this modrewrite rule has solved it somewhat:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^folder/(.*)$ /$1 [R=301,NC,L]

    that removes the /folder from most links, but now i have php includes that aren't doing the same thing...

    see http://www.immortalsoon.co.uk/pages/images/images.html

    it was originally http://www.inaudible.co.uk/crimea/pa...es/images.html
    using the code:
    PHP Code:
    <?php include($_SERVER['DOCUMENT_ROOT'] . '/crimea/pages/header.php'); ?>
    to include a header file from http://www.inaudible.co.uk/crimea/pages/header.php

    now i'm just getting an error which says:
    PHP Code:
    Warningmain(/home/inaueco/public_html/crimea/crimea/pages/header.php) [function.main]: failed to open streamNo such file or directory in /home/inaueco/public_html/crimea/pages/images/images.html on line 1 
    and the only thing i can see that's worng is the double /crimea/crimea/ and i have no idea how it got there or how to solve it.

    any suggestions? thanks.

    EDIT: ok changing
    PHP Code:
    <?php include($_SERVER['DOCUMENT_ROOT'] . '/crimea/pages/header.php'); ?>

    PHP Code:
    <?php include($_SERVER['DOCUMENT_ROOT'] . '/pages/header.php'); ?>
    solves it, but doesn't make sense. should document_root should be picking up the actual file system root (/home/public_html/folders...) and yet it acts as if it's just going on the domain name. and either way should it not be altered by the modrewrite rule above?
    Last edited by pepsi_max2k; 11-01-2007 at 06:06 PM.


Posting Permissions

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