How to manage example.com website from admin.example.com |
Hey,
I'd like to ask if it's possible to manage files, folders etc. of the main domain (example.com) from subdomain (e.g.: admin.example.com). I want to create (folders, upload files etc.) in the main domain but i can't while i get a 505 error. Have you faced anything like that? How did you solve it? Thanks! //Life motto if (sad() == true) { sad().stop(); develop(); }
That's a strange server response. What exactly are you doing to produce that?
(11-15-2018, 04:28 PM)dave friend Wrote: That's a strange server response. What exactly are you doing to produce that? It's something like a blog. But i placed the main site in "example.com" and the admin panel in "admin.example.com". What i also want is to be able to manage the files from subdomain. Is that possible? //Life motto if (sad() == true) { sad().stop(); develop(); }
Yes, it should be possible. (Did you post this question on Stack Overflow too? I have a suggestion there.)
But what's happening to cause a 505? That response means HTTP VERSION NOT SUPPORTED so I'd take a close look at any special headers you're setting. (11-15-2018, 06:50 PM)dave friend Wrote: Yes, it should be possible. (Did you post this question on Stack Overflow too? I have a suggestion there.) No i've not posted something on stack overflow! Every issue related to codeigniter is suddenly unknown for them! Let's not talk about it!! I think that it's something related to the config of the image upload. Here's the part of the "Posts" controller where i set the config for the image upload: Code: $post_id = random_string('numeric', 7); I think there's something wrong with the upload_path. //Life motto if (sad() == true) { sad().stop(); develop(); }
Could it be that first, you see if the path '../../htdocs/assets/img/posts ...'; exists
and if it does not you create a directory ../../petvres/assets/img/posts' But then you move forward with the first one as your upload directory. Which seem like some part of that must be a mistake, but there is much code you don't show meaning I don't understand all I know. I'm confused by what you're attempting to check with the path '../../htdocs/assets/img/posts' . $post_id. That relative path is not required. As far as the server is concerned the main script executing is index.php. So, unless your code has called chdir('/some/dir/); the current working directory is 'htdocs'. So I think what you really want is PHP Code: if( !is_dir('./assets/img/posts' . $post_id) ){ I don't see where you use $dir_exist but consider setting it like this PHP Code: $dir_exist = mkdir('/what/ever/it/is/really/supposed/to/" . "$be:, 0777, true); and I don't think any of this would cause a 505 server response. |
Welcome Guest, Not a member yet? Register Sign In |