A permanent redirect Header (HTTP status code 301) can originate from roughly 3 locations on an Apache web server:
- From the main Apache
httpd.conf
configuration file or one of the Includes loaded by the httpd.conf file.
- If AllowOverride is set it can be set from any
.htaccess
file in the path of the URL that gets redirected.
- From "code" (PHP, CGI scripts etc.) that gets executed by the web server.
And don't overlook alternative #4
- "code" (Javescript, JQuery etc.) that gets executed by the web browser.
Apache Redirect headers can be set with either mod_alias with the Redirect
, RedirectMatch
or RedirectPermanent
directives or with a mod_rewrite R
flag.
How "code" does that depends and will be a PITA to determine, but running a dumb web request (e.g. curl -v http://example.com/nice-page
) will show you if indeed a HTTP/1.1 301 Moved Permanently \n Location: http://...
response gets triggered by the web server as a Header, or if that is not the case then you should look at browser scripts.
Also note: a HTTP 301 Redirect is "Moved Permanently" and as such will be cached by both web browsers, CDN's and proxy servers and after you have removed the directive from a server config you may still observe it. You may need to test from a new anonymous browser window and/or clear your caches.
From your comment with the URL:
curl -v http://photographyconcentrate.com/camera-buying-guide
* Trying 104.27.188.166...
* TCP_NODELAY set
* Connected to photographyconcentrate.com (104.27.188.166) port 80 (#0)
> GET /camera-buying-guide HTTP/1.1
> Host: photographyconcentrate.com
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Date: Fri, 20 Jul 2018 11:26:41 GMT
< Transfer-Encoding: chunked
< Connection: keep-alive
< Cache-Control: max-age=3600
< Expires: Fri, 20 Jul 2018 12:26:41 GMT
< Location: https://photographyconcentrate.com/camera-buying-guide
< Server: cloudflare
< CF-RAY: 43d5130783252b40-AMS
That shows that your domain is using CloudFlare, a CDN and is indeed implemented with a 301 Moved Permanently
redirect header and not via java script.
That adds a complication, as the redirect can also be set on CF, and need not even be present on your webserver.
You can confirm if the redirect gets sent from your webserver or only by CloudFlare by by-passing CloudFlare and running:
curl -v -H "Host: photographyconcentrate.com" http://<real-IP-address-of-your-webserver>/