Jump to content


Photo

PHP and mod_rewrite


  • Please log in to reply
4 replies to this topic

#1 jfgreco915

jfgreco915
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 25 October 2006 - 01:55 PM

I have mod_rewrite working. However when it loads up the page it seems to ignore the include(example.php) and/or the require(example.php)

Any ideas?

#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 25 October 2006 - 01:58 PM

You want to post some code?

#3 jfgreco915

jfgreco915
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 25 October 2006 - 02:08 PM

.htaccess code for rewrite
RewriteEngine On
RewriteRule ^news/(.*) /view_news.php?t=vn&nid=$1


Page being redirected to.

<? include('header.php'); ?>
<table align="center" cellpadding="0" cellspacing="0">
<tr>
	<td align="left" class="news-head">News Archives -></td>	
</tr>
<tr>
	<td align="left" class="padding">
	<br>
	<?
		switch ($_GET['t'])
		{
			case('vn'):
				$bfd->view_news();
				break;
			default:
				$bfd->list_all_news();
				break;
		}
	?>
	</td>
</tr>
</table>
<br>
<? include('footer.php'); ?>



#4 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 25 October 2006 - 02:34 PM

So are you saying it is ignoring the include('header.php') call at the top of the page, or should I have another guess?

#5 jfgreco915

jfgreco915
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 25 October 2006 - 02:37 PM

Yes it is ignoring the includes and/or require at the top and the bottom.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users