HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

status code 404

uploaded open vanilla yesterday for a small group and it looks great but when I drag a document into the comment box I get request failed with status code 404. I have set the upload folder and the subfolders to octlal 755. What have I done wrong?

Comments

  • Options

    I have tried 777 as well, same reult.

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    Have you enabled pretty urls?

    If not, search this forum for RewriteUrls in the config.

  • Options

    Thanks, still struggling but will persevere

  • Options

    i modified .htacess for pretty url's and now I get request failed status code 500 ?

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    Sorry, I'm on mobile, therefore I cannot be that much of a help.

    Reverse the changes you have made to the htaccess

    Search this forum for "RewriteUrls". It must be an advice to add a line to your config.php line

  • Options

    when I add this line and try to start a new discussion the screen just goes blank.

    I really appreciate all the help.

  • Options

    Post the contents of your .htaccess file and confirm if your forum is in the root or a folder.

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    I assume there is some strange copy and paste behavior. Type this line into the config and try again. I assume you ended up with some malformed php which was the reason for the blank screen

  • Options

    This is my root .htaccess

    RewriteEngine On

    RewriteCond %{SERVER_PORT} !=443

    RewriteRule ^(.*)$ https://crickhowell.wales/$1 [R=301,L]


    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteCond %{REQUEST_FILENAME} !-d


    This is the .htaccess in my Vanilla directory (called 'calflag') and it is off the root of my site but not the root of my hosted space if that makes sense. I host several websites from the same 'space' on the server.

    # Original

    # If you modify this file then change the above line to: # Modified


    <IfModule mod_rewrite.c>

      RewriteEngine On


      ####

      # Certain hosts may require the following line.

      # If vanilla is in a subfolder then you need to specify it after the /.

      # (ex. You put Vanilla in /forum so change the next line to: RewriteBase /forum)

      ####

      #RewriteBase /


      # Make sure that / doesn't try to go to index.php without a rewrite :)

      DirectoryIndex disabled


      ####

      # Deny access to certain directories that SHOULD NOT be exposed.

      ####

      RewriteRule (^|/)\.git - [L,R=403]

      RewriteRule ^cache/ - [L,R=403]

      RewriteRule ^cgi-bin/ - [L,R=403]

      RewriteRule ^uploads/import/ - [L,R=403]

      RewriteRule ^vendor/ - [L,R=403]


      ####

      # Prevent access to any php script by redirecting the request to /index.php

      # You can add an exception by adding another RewriteCond after this one.

      # Example: RewriteCond %{REQUEST_URI} !^/yourscriptname.php$

      # You can comment out this section if it causes you problems.

      # This is just a nice to have for security purposes.

      ####

      RewriteCond %{REQUEST_URI} !/index.php$

      RewriteRule (.+\.php) [E=X_REWRITE:1,E=X_PATH_INFO:/$1,L]


      ####

      # Redirect any non existing file/directory to /index.php

      ####

      RewriteCond %{REQUEST_FILENAME} !-f

      RewriteRule (.*) index.php [E=X_REWRITE:1,E=X_PATH_INFO:/$1,L]


      ####

      # Add the proper X_REWRITE server variable for rewritten requests.

      ####

      RewriteCond %{ENV:REDIRECT_X_REWRITE} .+

      RewriteCond %{ENV:REDIRECT_X_PATH_INFO} (.+)

      RewriteRule ^index\.php - [E=X_REWRITE:1,E=!REDIRECT_X_REWRITE,E=X_PATH_INFO:%1,E=!REDIRECT_X_PATH_INFO,L]

    </IfModule>


    <IfModule mod_headers.c>

      <FilesMatch "(?<!embed)\.(css|js|woff|ttf|eot|svg|png|gif|jpeg|jpg|ico|swf)$">

       Header set Cache-Control "max-age=315360000"

       Header set Expires "31 December 2037 23:59:59 GMT"

      </FilesMatch>

    </IfModule>

  • Options

    I also redid the RewriteUrls line again manually and again a blank screen when I try to start a new discussion.

  • Options
    ianw5555ianw5555
    edited February 2021

    You will need to uncomment #RewriteBase /

    So it is RewriteBase /

    Then you need to put the path to the vanilla forum after the / ie. whatever is after example.com eg if it is examle.com/forum you would put

    RewriteBase /forum

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    The blank page is caused by a php error. Something happened when you edited it.

    Based on your knowledge you should either do a php -l conf/config.php from command line or paste the contents of your config to a online php linting service

    You might only have deleted a trailing semicolon and be able to see it by yourself.

  • Options

    What a hero, so many thanks, seems to be working now! I really appreciate your help. I will try some more and make sure all is well.

    Thanks again

  • Options

    Working just great, thank you all so much.

Sign In or Register to comment.