htaccess 重写:子域?

发布于 2024-10-04 01:36:25 字数 441 浏览 0 评论 0原文

我正在考虑重写我的网址,例如:

http://www.latox.org/ Category.php?cat=action

将变为

http://action.latox.org

这可能吗与 .htaccess 重写有关吗?

这样做明智吗?与 http://www.latox.org/category/action 相反,

您有什么建议?我将如何进行子域重写?

问候

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 would I go about doing the sub-domain rewrite?

Regards

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

2024-10-11 01:36:25

你的第一选择将是一场难以管理的噩梦。这意味着对于每个可能的 cat 值,您必须在 dns 文件中添加一些内容。第二种解决方案更好、更简单。另外,它还有一个额外的好处,可以提高你的谷歌业力。当人们总是指向同一个领域时,你的业力就会变得更高。

规则相当简单。

RewriteEngine on
RewriteRule ^/category/(.*)$ /category.php?cat=$1 [L]

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]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文