Page 1 of 1

having issues with mod-rewrite / .htaccess php

Posted: Thu Nov 13, 2008 4:40 pm
by codescript
This is my .htaccess file below

Code: Select all

 
Options +FollowSymLinks
RewriteEngine on
RewriteRule auto/id/(.*)/ auto.php?id=$1
 
Trying to re-write mywebsite.com/auto.php?id=3

to

mywebsite.com/title_of_vehicle/

need php code for mod-rewrite to translate link to mywebsite.com/title_of_vehicle/

sorry... kind of a beginner.

Re: having issues with mod-rewrite / .htaccess php

Posted: Thu Nov 13, 2008 4:50 pm
by requinix
You're trying to rewrite URLs in the wrong direction that mod_rewrite is set up for.

Make your auto.php redirect to where you want it to go.

Code: Select all

<?php
$id = $_GET["id"];
// look up the title
header("Location: /title-of-vehicle");
exit;