PDA

View Full Version : Mod Rewrite Condition



Michael D Price
04-18-2008, 12:13 AM
I have a client who has a script that uses mod rewrite but i his htaccess file is blank!

I looked around on the hompage of the script but couldnt find any information for it.

So i need a mod rewrite condition that will work.

Here are some pretty urls ...

http://www.goarticlego.com/category/general-news-now-1-1.html
http://www.goarticlego.com/article/the-work-from-home-internet-business-is-booming-on-the-net-3-1.html

And here are the php equivalents
http://www.goarticlego.com/category.php?cat_id=1
http://www.goarticlego.com/articles.php?art_id=3&start=1

Both category and article directories do not exist ...
However files name article and category DO exist. No extension on the file name.

Here is the content of the category file.


<?
if(isset($_GET['PATH_INFO']) or isset($_POST['PATH_INFO']))
die("Parameter error");

$MYVARS = explode("/",$PATH_INFO);
$script = $MYVARS[count($MYVARS)-1];
$arr = explode(".",$script);
$arr = explode("-",$arr[0]);
$arr = array_slice($arr,count($arr)-2,2);

$cat_id = $arr[0];
$start = $arr[1];

include "category.php";
?>


I am assuming that the mod rewrite needs to redirect to SOMETHING like this ...

can anybody help with this, or do you need more information?
/category?pathinfo=1

IvanAkimov
04-23-2008, 10:49 PM
are you sure you don't just want to use the .htaccess file. you'll have only one line in there as opposed to all this code and debugging. plus it'll be faster. (that file is a hidden file, so if the account is on bluehost, when you go to file manager and the little window pops up, enable the checkbox for showing hidden files.)

Michael D Price
04-24-2008, 06:20 AM
LOL ....

mod rewrite is for htaccess ....

anyway, I got it working, but thanks for your concern.