Jump to content

Recommended Posts

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

 

 

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?!  :shrug:

 

 

#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

 

 

 

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

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.