I am thinking of rewriting my urls, for example:
http://www.latox.org/category.php?cat=action
would become
http://action.latox.org
Is this possible to do with .htaccess rewrite?
Is this wise to do? As opposed to http://www.latox.org/category/action
What do you suggest? How w开发者_高级运维ould I go about doing the sub-domain rewrite?
Regards
Your first choice will be a nightmare to manage. It means for each possible cat values, you will have to add something in your dns file. The second solution is a lot better and simpler. Plus it has the side benefits of making your google karma higher. When people always point to the same domain your karma is getting higher.
The rules are fairly simple.
RewriteEngine on
RewriteRule ^/category/(.*)$ /category.php?cat=$1 [L]
精彩评论