Fwd: Subject: URL question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Easy enough, using Mod Rewrite on apache (you didn't say which server you use, so I'm afraid you'll have to upgrade if using IIS) : Create a file in a text editor. Save it as .htaccess (dot-htaccess as the filename) in the http://www.blablah.com/examples/ directory - not in the root folder or you'll route every page request on the site through your PHP script. If you're using [eg notepad], make sure it doesn't save it as .htaccess.txt !

The .htaccess file you create contains the following lines :

RewriteEngine on
RewriteBase /examples
RewriteRule (.* ) /examples/exampleprocessor.php?mls=$1 [L]


That short regex will take any character string and append it to the MLS query string, which you then process as normal in your PHP script (i.e. as if the user typed in a URL of http://www.blablah.com/examples/exampleprocessor.php?mls=blahblahblah


Make sure your script works fully with the checked query string before you do this ;-)

Cheers - Neil

Message-Id: <200504300300.j3U30Kb6000990@xxxxxxxxxxxxxxxxxxxxxxxxxx>
From: "Chris Payne" <cjp@xxxxxxxxxxxxxxxxx>
To: <php-db@xxxxxxxxxxxxx>
Date: Fri, 29 Apr 2005 23:00:27 -0400
MIME-Version: 1.0
Content-Type: multipart/alternative;
        boundary="----=_NextPart_000_0000_01C54D0F.3C23BB30"
Subject: URL question

Hi there everyone,



My client needs to be able to have their url www.blahblah.com
<http://www.blahblah.com/>  pickup the product number but I can't do it the
way I'd want (which would be www.blahblah.com/?mls=examplenumber, instead
they said it MUST be www.blahblah.com/examplenumber - how can I grab the
number AFTER the .com in PHP so that I can process it with MySQL without it
being assigned a variable name, just the number?



Chris


========================================================
CaptionKit http://www.captionkit.com : Production tools
for accessible subtitled internet media, transcripts
and searchable video. Supports Real Player, Quicktime
and Windows Media Player.

VideoChat with friends online, get Freshly Toasted every
day at http://www.fresh-toast.net : NetMeeting solutions
for a connected world.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux