简体   繁体   English

在配置文件中找不到apache配置重定向

[英]Can't find apache config redirect in config files

the goal 目标
Redirecting mydomain.com/something to mysite.com/something 将mydomain.com/something重定向到mysite.com/something

the problem 问题
Any domain that you throw at the server gets 302 redirected to www.mysite.com and, for the life of me, I can't find the config rule that is doing this! 您在服务器上抛出的任何域都将302重定向到www.mysite.com,并且对我来说,我找不到执行此操作的配置规则!

what i've done so far 到目前为止我做了什么
I've grepped everything in the /etc/apache2 folder for 'mysite.com', 'Redirect', 'redirect', and other, as well as scour by hand all the apache config files looking for this redirect rule to no avail. 我已经将/ etc / apache2文件夹中的所有内容全部复制为'mysite.com','Redirect','redirect'和其他文件,并手动搜索了所有apache配置文件,以查找此重定向规则无济于事。

Any and all help in finding the culprit redirect is greatly appreciated. 非常感谢发现元凶重定向的所有帮助。 I'm not a sysadmin so there must be a place I don't know of where this might be other than the /etc/apache2 folder... 我不是系统管理员,所以除了/ etc / apache2文件夹外,肯定还有一个我不知道的地方...

Thank you kindly for helping me with my first SO question :) 谢谢您帮助我解决第一个SO问题:)

The file which includes redirection rules does not have to be in /etc/apache2 folder. 包含重定向规则的文件不必位于/ etc / apache2文件夹中。 Check your document root folder (the path of which you can find in your vhost configuration file) for .htaccess files. 检查文档根文件夹(在vhost配置文件中可以找到其路径)中是否存在.htaccess文件。 They may have redirect rules too. 他们可能也有重定向规则。

The problem was with an .htaccess in the docroot of another domain on the server. 问题出在服务器上另一个域的docroot中的.htaccess。 This other domain was higher alphabetically and was treated as the default domain. 该其他域的字母顺序较高,被视为默认域。
I solved the problem by creating a new vhost for the domain that i wanted to redirect and it was handled properly. 我通过为要重定向的域创建一个新的虚拟主机解决了该问题,并对其进行了正确处理。
Thank you all for your help! 谢谢大家的帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM