htaccess中的永久重定向查询无法正常工作

时间:2017-12-18 00:11:45

标签: php apache redirect

我正在尝试创建从www http://abc.pk/到我网站的http://www.abc.pk/版本的重定向

我想将<IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> <IfModule pagespeed_module> ModPagespeed on ModPagespeedEnableFilters combine_css </IfModule> RewriteEngine On # Redirect Trailing Slashes If Not A Folder... # RewriteCond %{REQUEST_FILENAME} !-d # RewriteRule ^(.*)/$ /JobScholar/$1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] # Handle Authorization Header RewriteCond %{HTTP:Authorization} . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] </IfModule> 重定向到System.out.println(Arrays.toString(userReturn.getPicture())); [91, 45, 49, 44, 32, 45, 52, 48, 44, 32, 45, 49, 44, 32, 45, 51, 55, 44, 32, 48, 44, 32, 54, 55, 44, 32, 48, 44, 32, 56, ... ,但我的查询却没有正常工作

这是我的.htaccess

where is the problem

1 个答案:

答案 0 :(得分:1)

您可以尝试的简化版......

根据许多SOF答案之一的链接,你说这不是你的问题的重复。

在添加其他所有内容之前先启动并测试它。

我已经通过我系统上的箍运行它并故意破坏东西以确保一切正在运行......

RewriteEngine On
# Redirect all non www to www
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]