LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[Webdev] mod_rewrite revisted - the solution

[Webdev] mod_rewrite revisted - the solution

AJ McKee aj at nevermindthebollox.com
Tue Nov 6 21:51:11 GMT 2001


Well finally after sneaking around for a bit I figured it out. Its a bit 
flakey but I think I have the hang of it.

Ok what I have apache doing is the following
<Files test>
	ForceType application/x-httpd-php
</files>

Test is a file and in it I put my code to generate each section and article
--- SNIP-----
// Call the global; config file
require "../config/config.inc.php";
$var_array = explode("/", $PATH_INFO);
$file=$var_array[0];
$section=$var_array[1];
$articleid=$var_array[2];
if($section && $articleid)
    {
    // Ok a section has been selected. List all the articles for this section.
    $query = mysql_query("SELECT * from articles where 
articleid='$articleid'") or die ("could not execute");
    $ans = mysql_fetch_array($query);
    // Assign the content and titles to vars
    $section = $ans["section"];
    $title = stripslashes($ans["title"]);
    $intro = stripslashes($ans["intro"]);
    $content = stripslashes($ans["content"]);
    $image = $ans["image"];
---- End Snip

And its working well at the moment. The only problem being that the url is 
now /features/test/section/article.html

But this could be overcome quite easily as /features/ could now be the php 
file called test.  The cool thing is that it accepts arguments that are 
urlencoded because they have a space.

Cool and no mod_rewrite.

Got a lot of help from Adam Beecher guys, and also 
http://www.webmasterbase.com/article/485

Thanks all
Aj

---- New Sig
Soon to be Jobless will design badly for food ;-)
So will lots of my colleuges so if anyone can help please let me know
They Are a cool bunch of java,c and everyother developer come researcher 
including some cool ip researchers, and a kick ass marketing girl
http://www.nevermindthebollox.com/cv/whotheyare.php to find out where they 
worked. They are really cool honest.
---- THANK YOU ---




More information about the Webdev mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell