Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 url 重写时遇到问题。我想重写我当前显示为的 url, 我想显示为domain.com/index.php?lang=fr fr.domain.com
domain.com/index.php?lang=fr
fr.domain.com
任何帮助将不胜感激。谢谢
试试这个代码DOCUMENT_ROOT/.htaccess:domain.com
DOCUMENT_ROOT/.htaccess
domain.com
RewriteEngine On RewriteCond %{HTTP_HOST} ^domain\.com$ [NC] RewriteCond %{QUERY_STRING} (?:^|&)lang=([^&]+) [NC] RewriteRule ^ http://%1.%{HTTP_HOST}%{REQUEST_URI}? [NE,R=301,L]