Strange redirect (regular expression), and rewriteoptions inherit, in .htaccess
I discovered a strange redirect in an account today that I didn't place there (and no one else has access). It has regex in it, and calls a 302, permanent. (see screen shot)
1- How does one even place regex in a redirect in cPanel? I can't see any way to do it in the redirect interface.
2- Where is the info for this record stored? I can't find it in an .htaccess file and since it's "ALL" I didn't expect to, but I couldn't find how in cPanel docs.
3- Why/how does it list the redirect as 302, yet permanent?
4 (for bonus points) - I found "rewriteoptions inherit" in the main domain's .htaccess, and in some addon domain .htaccess files, and I don't know how they were put in there. (I know what it does, and I would not have put it there.) I can't find this in cPanel docs, or in any experimentation either.
-
Hey there! That interface is able to pull data directly from the .htaccess file - that means that even though you may not be able to do something inside cPanel, it will show up there if it reads it from the file.
Are there other .htaccess files on the account besides the main /home/username/public_html? Each directory can have one, so it could be anywhere.
0 -
Pulling from .htaccess...Is that a new thing? I often add things manually and don't remember ever seeing that happen. So the interface tries to pull data from all/any .htaccess files in the account?
This account has many addon domains, all at the same level as public_html though. I do know there can be many .htaccess files. :) But this is an "ALL" redirect, and that seems like it would have to be applied somewhere else... where?
How would that account for the redirect being listed as as 302, yet permanent?
So is regex only in the interface to accommodate regex pulled from the file, yet can't be added via the interface? (The docs were oddly silent about this.)
And could this be related to many (not all) .htaccess files having "rewriteoptions inherit" in them (even if there are no .htaccess files above them)? It there any process in cPanel that would add that? I know for sure they were not manually added.
0 -
Pulling from .htaccess directly is how the interface has always been as long as I can recall. Since there are different domains mentioned on the left side that would indicate it's pulling from multiple sources as well.
I don't have a good explanation for the "ALL" redirect so we may need to see a ticket on this if you can't determine where that is coming from.
0 -
I'm sure I can find the .htaccess file this was pulled from. I'll get back after that if there are concerns. I'm pretty sure I know which software installed the rule in its .htaccess file.
I'm also wondering if it's responsible for the "RewriteOptions inherit" in all the top level .htaccess files in the account (for addon domains). Putting it in a top level file makes no sense to me, so I might need to ask the dev on it. The software is only installed for one domain; a subdomain of the domain in public_html. (All addons/subdomains are in a folder beside public_html.) But can you check with your devs to see if there is a circumstance where cPanel would add that?
I'd like to get a link(s) to docs regarding regex in redirects. How would one do that *in* cPanel (or is is only there to accommodate regex if pulling in from an .htaccess file)?
Also, docs on where a redirect is stored when an "ALL" redirect is created from within cPanel would be helpful.
Thanks!
0 -
I don't think we have any docs that are that specific. We'd likely need to examine your situation to see what exactly is going on, and then if we find something odd we could update or add to existing documentation from there.
0
Please sign in to leave a comment.
Comments
5 comments