PDA

View Full Version : Rewrite Problems


WMIT
03-12-2005, 01:13 PM
Hi everyone.

i know this has been discussed before
i copied this from Sitami's post a while ago

RewriteEngine On
RewriteRule ^(http://www.mydomain.com)/([a-zA-Z0-9_]*)/? $1/outbound.php?oblid=$2

in outbound.php it queries the db for the url to redircect to and then redirects using the header("Location :" .$result['url'])

if i go to mydomain.com/outbound.php?oblid=1 then it works

but if i go to mydomain.com/1 nothing happens except a 404

the rewrite rule is turned on

any ideas will be welcomed

thanks

cyphix
03-13-2005, 06:35 PM
Try this..

RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteRule ^(http://www.mydomain.com)/([a-zA-Z0-9_]*)/? $1/outbound.php?oblid=$2

WMIT
03-14-2005, 12:43 AM
hi ..
nope still coming up with a 404 :(

cyphix
03-14-2005, 09:58 AM
Ok. I messed around for awhile & I couldn't get anything to work without using a subdirectory path... this works..


RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteRule ^items/([A-Za-z0-9]*) /outbound.php?oblid=$1


Mess around some more & maybe u will sort it out.... or search for some tutorials on mod rewrite. :)