Welcome to WebmasterWorld Guest from 54.166.87.123

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Create apache rewrite rule dynamically

   
2:18 am on Jun 21, 2014 (gmt 0)

10+ Year Member



Dear All

We want to use apache rule for dynamic / CMS based website

we want

myweb.com/myname001 to direct to myweb.com/abcd.php?id=100
myweb.com/myname002 to direct to myweb.com/abcd.php?id=200
myweb.com/myname003 to direct to myweb.com/abcd.php?id=300

All these entried are from table mtable in database

An user can add more records / entries to mtable how do i generate the apache rule in that case
6:25 am on Jun 21, 2014 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



How do you get from 001 to 100, 002 to 200 and so on? Will it always be a mirror-image reversal from one to the other? Or is there some other pattern?

It looks as if what you want is a simple capture and reuse. But before we go any further we need to figure out exactly what you're doing. You don't really want to redirect from a short-and-simple URL such as "myname001" to a longer and uglier URL such as "abcd.php?id=100" do you? I tend to suspect that what you really want to do is rewrite: when the URL says such-and-such, quietly serve content from somewhere else.