开发者

htaccess rewrite : subdomain?

开发者 https://www.devze.com 2023-01-26 14:06 出处:网络
I am thinking of rewriting my urls, for example: http://www.latox.org/category.php?cat=action would become

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]
0

精彩评论

暂无评论...
验证码 换一张
取 消