1

i have a code(writen in codeigniter) running on sub-domain inside cakephp webroot directory, code is written in codeigniter, When a post request is sent with some input values it works fine, but when values change to some other, it return 403 error. In case of 403 error, server do not hand over the request to main index.php of codeigniter. Try to debug alot, but nothing seems to work. It seems that apache sending 403, But i am unable to figure it out what is causing it.

i have make chnages to .htaccess and using phpinfo() verify the changes, but nothing work. Can any one guide me. Thanks in advance

What i have tried:

  1. i tried checking error log files, it just says "File not found [/home2/maindomain/subdomain/app/webroot/403.shtml]"

  2. also tried to print request in main index.php, do not got any thing when it throws 403, in success case it shows stack trace or what ever i print or echo. this shows in case of 403, request is not handed over to index.php

  3. AS you can see in .htaccess i have changed memory and time limits, but still no effect Php version : 5.6

  4. From browser console, request is same, no change, just variable values changes, cookie and every other thing is same

  5. I have also checked CSRF, its off. so checked config.php things as well.

  6. i have also tried log error to my location and in my error log file nothing comes up.

.htaccess filde code

    AllowOverride Options
    AllowOverride All
    php_flag display_errors On
    php_flag display_errors Off
    php_value post_max_size 512M
    php_value memory_limit 512M
    php_value max_execution_time 300
    php_value max_input_vars 10000
    php_Value display_errors on
    php_value display_startup_errors on
    php_value upload_max_filesize 128M

    DirectoryIndex index.php
    RewriteEngine On
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^ index.php [L]

in case of error server response is "Forbidden

Access to this resource on the server is denied!"

In success its a valid json.

1 Answer 1

0

Could you please add more details about your input value and then change it then doesn't work? by the way, you've mentioned you have a subdomain probably there is some configuration to check inside your vhost, did you check it in the folder /etc/apache2/sites-available/default?

7
  • Its shared hosting, so i have only access to cpanel Commented Nov 12, 2019 at 8:43
  • About input, i cannot write it here, its size is 176kb, and there is not option of attachment here. Commented Nov 12, 2019 at 8:50
  • Unfortunately, you didn't give more clarification about your issue, I advise you to put a file index.php and put a print('for test'), and check if your script works, however, if you get the same error 403 then you check with your hosting support. Commented Nov 12, 2019 at 9:37
  • I think my question details are very detailed, as same thing works for some inputs, and for some other inputs code do not got control at all. so problem is in php ini settings, but not able to find which one is it Commented Nov 12, 2019 at 10:16
  • did you put an index.php with print('test on'); as I said ? Commented Nov 12, 2019 at 10:43

Not the answer you're looking for? Browse other questions tagged or ask your own question.