Forum Moderators: Robert Charlton & goodroi
Some spammers use it until now, have many virtual directories with duplicated content, now they can't do that
www.domain.com/keyword/
www.domain.com/keyword1/
server have only a site but many virtual directories with same content. A old spam tecnic.
I believe you can configure mod_mime_magic to get round this, but presume this is a performance drag because it means Apache has to look at every file to determine (= make an educated guess about) the mime type.
It's also possible for highly customizable CMS systems to be able to map arbitrary URLs and filenames to particular types of content.
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(.*)/(.*)$ index.php?topic=$1&page=$2 [L]
Which means that when you type www.example.com/veggies/carrot their server responds as if you had typed www.example.com/index.php?topic=veggies&page=carrot
If this is not implemented carefully they could be in duplicate content hell if someone decided to play with them, as in any cms. They have probably disallowed any ?'s in requests so that you can't get www.example.com/index.php?topic=veggies&page=carrot and cause a duplicate content penalty.
They should also validate that the page you are trying to get is associated with the topic you have indicated. Otherwise a request for www.example.com/utensils/carrot would yield duplicate content.
You have to be careful when doing this.
--
[w3.org...]
"What to leave out
File name extension. This is a very common one. "cgi", even ".html" is something which will change. You may not be using HTML for that page in 20 years time, but you might want today's links to it to still be valid. The canonical way of making links to the W3C site doesn't use the extension."
This works perfectly for the index file in the root folder. but how do I rewrite it for a file residing in an inside folder say
I want to pass the values topic=veggies&page=carrot to a index file insided the directory dir1 www.example.com/dir1/index.php
If you want to exclude some subdirs so they are treated as actual dirs instead of variables this is what you want:
RewriteCond %{REQUEST_URI}!((/sub1/)¦(/sub2/)¦(/sub3/))
RewriteRule ^(.*)/(.*)$ index.php?topic=$1&page=$2 [L]
Edit: WebmasterWorld mangles the "¦", press the key to the left of 1 to get the correct one.
It's nothing special, just a name without a dot and some letters at the end.