我有这个.htacces文件我很喜欢它,但是如何向它添加多语言?所以它明白localhost/en/
不是文件或文件夹。现在它使用公共文件夹作为“根”所以localhost
= public/
如果我想这样做,那太好了,我仍然使用公共文件夹作为根目录,但 url 中的第一个 // 是语言
例子:localhost/en/
= 链接到公共文件夹并且localhost/it/
还链接到公共文件夹
示例2:localhost/en/admin
链接到public/admin/
PS:public/ 不应出现在 URL 中
除了语言部分之外,这段代码完全符合我的要求。
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/(public)/
RewriteRule (.*) /public/$1
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteCond %{REQUEST_URI} !/$
RewriteRule (.*) $1\.php [L]
ErrorDocument 401 /errors/errors.php
ErrorDocument 404 /errors/errors.php
ErrorDocument 500 /errors/errors.php
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)