Quote:
Originally Posted by Pasco
works perfectly - thanks!
Just for my understanding: I could have done that with mod_rewrite too?
Cheers, p@sco
|
yeah you could have, something like this:
RewriteEngine on
RewriteRule ^demo\demo.iso$ demo.html
The caret, ^, signifies the start of an URL, under the current directory. This directory is whatever directory the .htaccess file is in. You’ll start almost all matches with a caret.
The dollar sign, $, signifies the end of the string to be matched. You should add this in to stop your rules matching the first part of longer URLs.
The period or dot before the file extension is a special character in regular expressions, and would mean something special if we didn’t escape it with the backslash, which tells Apache to treat it as a normal character.
So, this rule will make your server transparently redirect from demo\demo.iso to the demo.html page. Your reader will have no idea that it happened, and it’s pretty much instantaneous.
NOTE:
RewriteEngine on (only needs to be specified once in your .htaccess file).
Recent comments
1 day 1 hour ago
1 day 8 hours ago
1 day 12 hours ago
1 day 14 hours ago
1 day 22 hours ago
2 days 7 hours ago
2 days 8 hours ago
2 days 12 hours ago
2 days 16 hours ago
2 days 17 hours ago