Owlcroft
Mar 23rd 2004, 4:16 pm
My domain is hosted on an ISP. That ISP assures me that the mod_rewrite module is available, and that I can use it from an .htaccess file in my directory.
Here are the data, and what I am trying to do; I hope someone can tell me exactly how to do it.
The actual address of the directory in which the top-level files for the site exist is:
/usr/home/ewalker/public_html/validsff
The directory in which the php file at issue resides is one down:
/usr/home/ewalker/public_html/validsff/PHP
The URL that is directed into the top-level directory is:
http://greatsfandf.com
What I want to do is to transform a call that looks like this:
http://greatsfandf.com/XX/yyyyyyyyyy.html
(where XX is one of six possible two-letter upper-case alphabetic codes, and yyyyyyyyyy is a ten-character upper-case alphanumeric code) into this call:
http://greatsfandf.com/PHP/
onebook.php?natl=zzzzzz&asin=yyyyyyyyyy
[line split to fit screen]
(where zzzzzz is some text uniquely determined by the value of XX).
I assume I will want six rules, one for each posible value of XX.
I have tried various permutations of text in the .htaccess file, but none have produced anything but a 500 error. The last lines I tried--using "UK" for XX and what you see below for zzzzz--looked like this:
RewriteEngine on
Rewrite Base /usr/home/ewalker/public_html/validsff
Rewrite Rule ^/UK/[A-Z0-9]{10}.html$ validsff/PHP/onebook.php?myid=greatsciencfi-21&asin=$2
My guess is that the problem lies in the Base, but I also do not quite understand the caret ^ character, which some articles show and some don't and none explain; nor am I sure if I want $1 or $2.
Help, please?
Here are the data, and what I am trying to do; I hope someone can tell me exactly how to do it.
The actual address of the directory in which the top-level files for the site exist is:
/usr/home/ewalker/public_html/validsff
The directory in which the php file at issue resides is one down:
/usr/home/ewalker/public_html/validsff/PHP
The URL that is directed into the top-level directory is:
http://greatsfandf.com
What I want to do is to transform a call that looks like this:
http://greatsfandf.com/XX/yyyyyyyyyy.html
(where XX is one of six possible two-letter upper-case alphabetic codes, and yyyyyyyyyy is a ten-character upper-case alphanumeric code) into this call:
http://greatsfandf.com/PHP/
onebook.php?natl=zzzzzz&asin=yyyyyyyyyy
[line split to fit screen]
(where zzzzzz is some text uniquely determined by the value of XX).
I assume I will want six rules, one for each posible value of XX.
I have tried various permutations of text in the .htaccess file, but none have produced anything but a 500 error. The last lines I tried--using "UK" for XX and what you see below for zzzzz--looked like this:
RewriteEngine on
Rewrite Base /usr/home/ewalker/public_html/validsff
Rewrite Rule ^/UK/[A-Z0-9]{10}.html$ validsff/PHP/onebook.php?myid=greatsciencfi-21&asin=$2
My guess is that the problem lies in the Base, but I also do not quite understand the caret ^ character, which some articles show and some don't and none explain; nor am I sure if I want $1 or $2.
Help, please?