apache重写不路由unicode URL
我使用的是Xampp[Apache/2.4.23(Win32)OpenSSL/1.0.2h PHP/5.5.38] 当我通过别名域名如domain.dev(在windows主机中设置为重定向到127.0.0.1)进行路由时,一切都正常工作(URL如apache重写不路由unicode URL,apache,.htaccess,mod-rewrite,utf-8,Apache,.htaccess,Mod Rewrite,Utf 8,我使用的是Xampp[Apache/2.4.23(Win32)OpenSSL/1.0.2h PHP/5.5.38] 当我通过别名域名如domain.dev(在windows主机中设置为重定向到127.0.0.1)进行路由时,一切都正常工作(URL如domain.dev/ایت路由正确),但当我使用localhost/site_root/㶋یت时,我得到404 not found error 所有非unicode/utf8 URL均正确路由;例如localhost/site\u root/path
domain.dev/ایت
路由正确),但当我使用localhost/site_root/㶋یت
时,我得到404 not found error
所有非unicode/utf8 URL均正确路由;例如localhost/site\u root/path1/path2
我已经在apache/conf/extra/httpd-multilang-errordoc.conf中注释了行Alias/error/“D:/xampp/apache/error/”
,作为对允许的域访问的注释
以下是相关的配置/文件:
主机:
NameVirtualHost *:80
NameVirtualHost *:443
<VirtualHost *:80>
DocumentRoot "D:/xampp/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "D:/xampp/htdocs/site_root"
ServerName domain.dev
ServerAlias demo.domain.dev
</VirtualHost>
<FilesMatch "\.(ttf|ttc|otf|eot|woff)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
IndexOptions +Charset=UTF-8
RewriteEngine On
RewriteRule ^(.*)/index/?$ $1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ $1 [L,R=301]
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
127.0.0.1域.dev
apache/conf/extra/httpd vhosts.conf:
NameVirtualHost *:80
NameVirtualHost *:443
<VirtualHost *:80>
DocumentRoot "D:/xampp/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "D:/xampp/htdocs/site_root"
ServerName domain.dev
ServerAlias demo.domain.dev
</VirtualHost>
<FilesMatch "\.(ttf|ttc|otf|eot|woff)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
IndexOptions +Charset=UTF-8
RewriteEngine On
RewriteRule ^(.*)/index/?$ $1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ $1 [L,R=301]
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
NameVirtualHost*:80
名称虚拟主机*:443
DocumentRoot“D:/xampp/htdocs”
服务器名本地主机
DocumentRoot“D:/xampp/htdocs/site\u root”
ServerName域.dev
ServerAlias demo.domain.dev
htdocs/site\u root/.htaccess:
NameVirtualHost *:80
NameVirtualHost *:443
<VirtualHost *:80>
DocumentRoot "D:/xampp/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "D:/xampp/htdocs/site_root"
ServerName domain.dev
ServerAlias demo.domain.dev
</VirtualHost>
<FilesMatch "\.(ttf|ttc|otf|eot|woff)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
IndexOptions +Charset=UTF-8
RewriteEngine On
RewriteRule ^(.*)/index/?$ $1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ $1 [L,R=301]
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
标题集访问控制允许原点“*”
索引选项+字符集=UTF-8
重新启动发动机
重写规则^(.*)/索引/?$$1[L,R=301]
重写cond%{REQUEST_FILENAME}-D
重写规则^(+)/$$1[L,R=301]
重写COND%{REQUEST_URI}^系统*
重写规则^(.*)$/index.php/$1[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(.*)$index.php/$1[L]