a question that I hope does not sound crazy: On a multilingual site, imagine several actual files with contents in them which are currently reachable under their file names:
website.org/en/tomato.php
website.org/nl/tomato.php
website.org/de/tomato.php
These are all one and the same php file, the folder infront of it tells the php to fetch what content. Now this name is short and handy for my file managemens, but the file names are all very unsexy for search engines. So, what are the ways to make these flat files having more exotic names like:
website.org/en/tomato.php-fist-The-Forgotten-Red-Punch
website.org/nl/tomaat.php-vuist-De-Vergeten-Rode-Vuist
website.org/de/tomate.php-faust-Die-Fergessen-Rote-Faust
Currently, my php nderstands the folder /en/ or /nl/ preceding the filenames and puts the correct language into the tomato.php file.
It is my dream to have a per language file name which then somehow tells php/apache to make it work and fetch invisibly underneath the naming engine the correct file.
I am really not ready for a cms framework, I’m happy I can manage my flat files myself. What would be a creative way to have a links management where sothat I can tags my links above the water more exoticly, while keeping the short file names below water for myself?
Solutions/ideas/suggestions/code are all very welcome and treated as possible answers and are Much appreciated.
This is very common to handle with Apache and
mod_rewrite… there are a number of ways to do this – the most common way is to rewrite all files to index.phpIn .htaccess:
RewriteRule .* index.php [L]Then in your index.php check PATH_INFO and compare against your database for the associated real file.
A few tutorials here:
http://techie-buzz.com/how-to/create-seo-friendly-urls-using-mod-rewrite-and-php-part-1.html
http://articles.sitepoint.com/article/search-engine-friendly-urls