doubledee Posted August 10, 2011 Author Share Posted August 10, 2011 First off, how does my Mod_Rewrite look otherwise?? Yeah, looks good. Secondly, what needs to be fixed to address this issue? (And why exactly isn't it working?!) Are you using urls to include files? You shouldn't be. Post some relevant code. Here is some code to help answer your question. config.php <?php define('ENVIRONMENT', 'development'); // define('ENVIRONMENT', 'production'); // File Root define('ROOT', ENVIRONMENT === 'development' ? '/Users/user1/Documents/DEV/++htdocs/01_MyProject/' : '/var/www/vhosts/MyWebsite.com/httpdocs/'); // Web Server Root define('WEB_ROOT', ENVIRONMENT === 'development' ? 'http://localhost/01_MyProject/' : 'http://www.MyWebsite.com/'); // Secure Web Server Root define('SECURE_WEB_ROOT', ENVIRONMENT === 'development' ? 'http://localhost/01_MyProject/' : 'https://www.MyWebsite.com/'); ?> article.php <body> <div id="wrapper" class="clearfix"> <div id="inner"> <!-- Include BODY HEADER --> <?php require_once(ROOT . 'components/body_header.inc.php'); ?> <!-- MIDDLE COLUMN --> <div id="middle_2col"> <div class="box_Content"> <!-- ARTICLE --> <div id="article"> Debbie Quote Link to comment https://forums.phpfreaks.com/topic/244133-need-help-switching-from-physical-to-virtual-set-up/page/2/#findComment-1255376 Share on other sites More sharing options...
trq Posted August 10, 2011 Share Posted August 10, 2011 That should be fine. Do you have error reporting enabled? What errors are you getting? Quote Link to comment https://forums.phpfreaks.com/topic/244133-need-help-switching-from-physical-to-virtual-set-up/page/2/#findComment-1255609 Share on other sites More sharing options...
doubledee Posted August 11, 2011 Author Share Posted August 11, 2011 That should be fine. Do you have error reporting enabled? Via NetBeans. What errors are you getting? No errors. I just get a plain HTML page with no styles or header. So what is wrong with my mod_rewrite script in my .htaccess file?! #PRETTY: articles/postage-meters-can-save-you-money #UGLY: article.php?title=postage-meters-can-save-you-money RewriteRule articles/([a-zA-Z0-9_-]+)$ article.php?title=$1 Because I am just looking for patterns like articles/([a-zA-Z0-9_-]+)$ and rewriting it as article.php?title=([a-zA-Z0-9_-]+) I don't see where the path is coming into play?! And if the path was an issue, wouldn't it not display my article? You saw what I'm doing to include my Header file. Here are the contents of body_header.inc.php <?php $page = basename($_SERVER['REQUEST_URI']); if ($page == '/') { $page = "index.php"; } ?> <div id="header"> <a href="<?php echo WEB_ROOT ?>index.php"> <img id="logo" src="<?php echo SECURE_WEB_ROOT ?>images/MyLogo.png" width="220" alt="My Logo" /> </a> <p id="welcome"> Welcome to my website... </p> <ul id="topMenu"> <li <?php if($page=="") echo ' class="current"'; ?>> <a href="<?php echo WEB_ROOT ?>index.php">Home</a> </li> <li></li> <li></li> </ul><!-- End of #TOPMENU --> </div><!-- End of #HEADER --> I'm really stuck here... Debbie Quote Link to comment https://forums.phpfreaks.com/topic/244133-need-help-switching-from-physical-to-virtual-set-up/page/2/#findComment-1255651 Share on other sites More sharing options...
doubledee Posted August 11, 2011 Author Share Posted August 11, 2011 Thorpe (or anyone), are you there? I'm dreadfully stuck on this and can't figure it out... Could definitely use some help! Thanks, Debbie Quote Link to comment https://forums.phpfreaks.com/topic/244133-need-help-switching-from-physical-to-virtual-set-up/page/2/#findComment-1255988 Share on other sites More sharing options...
trq Posted August 11, 2011 Share Posted August 11, 2011 I'm not sure what 'via netbeans' means. You need to run error reporting on in your php.ini. Calls to require_once will generate an error if they fail. Quote Link to comment https://forums.phpfreaks.com/topic/244133-need-help-switching-from-physical-to-virtual-set-up/page/2/#findComment-1256140 Share on other sites More sharing options...
doubledee Posted August 12, 2011 Author Share Posted August 12, 2011 I'm not sure what 'via netbeans' means. You need to run error reporting on in your php.ini. Calls to require_once will generate an error if they fail. It means NetBeans has a built in debugger... And like I said I am not getting any errors. My stylesheets are just not working. Debbie Quote Link to comment https://forums.phpfreaks.com/topic/244133-need-help-switching-from-physical-to-virtual-set-up/page/2/#findComment-1256231 Share on other sites More sharing options...
trq Posted August 12, 2011 Share Posted August 12, 2011 Your style sheets aren't working? I thought your includes weren't working. Did you read cag's reply? Quote Link to comment https://forums.phpfreaks.com/topic/244133-need-help-switching-from-physical-to-virtual-set-up/page/2/#findComment-1256246 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.