Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 13th, 2007, 01:55 PM
Friend of Wrox
Join Date: Jun 2003
Location: Oklahoma City, Oklahoma, USA.
Posts: 249
Thanks: 0
Thanked 0 Times in 0 Posts
Default link problem with mod_rewrite

Does anybody work with mod_rewrites and could help me understand this, I am new to using these and I have spent alot of time trying to figure this out. Any help is greatly appreciated.

This is my php being pulled from the DB
$strRet .= "[list]";
while ($row = mysql_fetch_array($result)) {
$strRet .= "<li>";
$strRet .= "<a href=\"tableofcontents/{$row['chapterID']}\">{$row['chapterTitle']}</a>";
$strRet .= "</li>";
$strRet .= "</ul>";

I am using this RewriteRule
RewriteRule ^manual/chapters/tableofcontents/?([0-9]+)? manual/chapters/tableofcontents.php?chapter=$1

What I am not understanding is that when I come to the link http://www.mysite.com/manual/chapters/tableofcontents the first time everything works correctly.
Now when I select the link above my page goes to http://www.mysite.com/manual/chapters/tableofcontents/9 everything on the page appears fine,
but now my links change too http://www.mysite.com/manual/chapter...leofcontents/9 then everytime afterwards it keeps adding a tableofcontents/

My question is why would it keep adding that table of contents?

Thanks Mike
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
mod_rewrite stevenpup ASP.NET 2.0 Basics 2 December 22nd, 2007 05:54 PM
mod_rewrite question harpua Pro PHP 0 April 12th, 2007 08:56 PM
Mod_rewrite heerajee Pro PHP 1 March 8th, 2006 06:35 AM
mod_jk + apache + mod_rewrite fanch Apache Tomcat 0 December 5th, 2005 12:34 PM
Apache mod_rewrite() anshul Linux 2 October 14th, 2005 09:09 AM

All times are GMT -4. The time now is 05:55 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.