I've been plyaing around with mod_rewrite for quiet a while now on and off (this is a follow up to thread65-1193672 which has been closed now). I have a directory called test which is in the root of the and I then have a folder called authors in here. In the authors folder are two files - index.php and author.php. I want people to go to /test/authors/name and mod_rewrite will get the content from /test/authors/author.php?author=name. I've created a .htaccess file in the authors directory and put the following in there
However it never grabs the data. So I put a test in author.php to echo the variable name and it's always author.php for some reason. So escentially it's pointing to /test/authors/author.php?author=author.php - even if I replace the $1 with $2 it still does the same thing. Can anybody help me out with this at all?
Second question, index.php in the authors folder is a list of all of the authors. i want to link to /test/authors rather than /test/authors/index.php - but doing so invokes the mod-rewrite so how do I tell mod-rewrite that if the URL is /test/authors/ then don't do any mod_rewrite - instead return index.php?
Thanks in advance for any help
Irish Poetry - Karen O'Connor
Get your Irish Poetry Published
Garten und Landschaftsbau
Code:
RewriteEngine on
RewriteRule ^(.*)$ author.php?author=$1 [T=application/x-httpd-php]
Second question, index.php in the authors folder is a list of all of the authors. i want to link to /test/authors rather than /test/authors/index.php - but doing so invokes the mod-rewrite so how do I tell mod-rewrite that if the URL is /test/authors/ then don't do any mod_rewrite - instead return index.php?
Thanks in advance for any help
Irish Poetry - Karen O'Connor
Get your Irish Poetry Published
Garten und Landschaftsbau