子域的.htaccess URL重写

编程入门 行业动态 更新时间:2024-10-27 19:20:01
本文介绍了子域的.htaccess URL重写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想重写一个URL,但我一直没有得到任何适当的结果。

I would like to rewrite an url, but I always do not get any adequate results.

我想网址 something.domain/index.php?arguments ... 实际访问 domain/index.php?username=something&arguments ......

I would like the url something.domain/index.php?arguments... to actually visit domain/index.php?username=something&arguments...

我曾尝试与做一个通配符项* .domain并使用互联网上的一些code,但毫无效果。

I have tried with making a wildcard entry *.domain and using some code on the internet, but nothing worked.

我不断收到一个默认网站页面 任何想法如何解决这个问题?

I keep getting a "Default Website Page" Any ideas how to solve this problem?

推荐答案

您可以在<$ C $你的 DOCUMENT_ROOT /的.htaccess 文件中使用此code C>的东西域名:

You can use this code in your DOCUMENT_ROOT/.htaccess file of something domain:

RewriteEngine On RewriteCond %{HTTP_HOST} ^([^.]+)\.(domain\)$ [NC] RewriteRule ^(index\.php)$ %2/$1?username=%1 [L,QSA,NC,R]

更多推荐

子域的.htaccess URL重写

本文发布于:2023-10-31 17:29:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1546776.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:重写   htaccess   URL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!