WordPress upload 500
My .htaccess files are intercepting WordPress’ .htaccess file.
Which modules and which settings (specified by .htaccess ) are required for WordPress to work? In other words, where can I find WordPress’ default .htaccess file?
Here is the default code for that file.
you can check it here for default htaccess file.
Thanks. I hope it helps little.
WordPress does not contain .htaccess in file form.
The rules are written into file by save_mod_rewrite_rules() function and are generated by $wp_rewrite->mod_rewrite_rules() .
Note that multisite installation has different (more complex) rules and seems to be handled differently.
Use the Freenode’s #wordpress to find the appropriate documentation, usually in the /topic . There I found the key Class WP_Rewrite here, the official wordpress.org is at the best misleading and marketing. Anyway, do not mix Apache’s rewrite rules with WP’s rewrite rules although the naming of WP is probably from Apache’s equivalent.
The WP_Rewrite API states
You can add rules to trigger your page view and processing using this component. The full functionality of a front controller does not exist, meaning you can’t define how the template files load based on the rewrite rules.
so you must use the API to do the changes, not fully sure what it means but I think it means you cannot trust in your hard-coded .htaccess -files — things may change even with different WD -versions! So use the API.
The code here has some conditions if the .htaccess -file exists — not 100% of their inferences because not well-documented and cannot understand the naming there but the central message is probably that the safe way to maintain the rewrite rules is to use the WP_Rewrite API, WP may change in the future.
For example, a simple Apache-rewrite RewriteRule ^hello$ Layouts/hello.html [NC,L] is apparently something like add_rewrite("^hello$", "Layouts/hello.html") , haven’t tested but tried to follow the API below:
Thanks to toscho for assisting here, some small-talk in chat.
Uploading Large Files to Azure Web Apps
Attempting to upload a file larger than 28.6MB to Azure Web Apps can result in a HTTP 404.13 for WordPress developers or a HTTP 502 for Tomcat Manager. This can be due to the default Request Limits value for the maxAllowedContentLength on IIS which is 30000000 (roughly 28.6MB). To modify this value, add the following to your web.config file.
You may also need to make changes to your Web App to increase the maximum file upload size as well. Below is some additional information for how to increase the limits for popular Content Management Systems that run on PHP such as WordPress, Drupal, and Joomla!. Information for Tomcat Manager can be found here.
PHP Content Management Systems (WordPress, Joomla!, etc.)
WordPress and other CMS site have its own maximum file upload size which are based on the default PHP values. These can be modified by creating a “.user.ini” file. Azure Web Apps developers can create/modify this file by performing the following.
2. Go to the “site” directory then the “wwwroot” directory.
3. To create a “.user.ini” file, go to the console window below and type “touch .user.ini”.
4. Once the file is created, press the edit button next to the file.
5. Add the following values to the file and press Save.
6. Restart your site.
NOTE: For WordPress Multisite users, you will also need to modify the Network Admin Settings to increase the value.
1. Select Network Admin -> Settings
2) Scroll down to the “Upload Setting” section and modify the “Max upload file size” then press “Save Changes”.
How to Bulk Upload Files to WordPress Media Library via FTP
Bulk uploading files to your WordPress media library allows you to upload a large number of files or files with large file sizes without the pains of trying to use the WordPress built-in upload functionality. But while this process can definitely make your life easier in certain situations, it’s not quite as simple as just uploading files via FTP. You’ll need to complete a few added steps if you want those files to actually be available inside your WordPress media library. Below, we’ll take you through the full process from start to finish.
When Is It Helpful to Bulk Upload Files to Your WordPress Media Library?
The regular WordPress media library upload functionality is perfectly fine as long as you’re not trying to upload:
- Files with large file sizes (some WordPress sites have a max upload size as low as 2MB by default)
- Large numbers of individual files (think in the hundreds)
But there may come a time when you need to complete one of the above actions. And in those situations, bulk uploading files to your media library via FTP offers a much better solution than trying to use the built-in media library upload tool.
Still looking for that perfect WordPress host?
- Fully managed
- Secure like Fort Knox
- Free migrations
- Ultimate speed
- Daily backups
- Google Cloud Platform
Why Can’t You Just Upload Files Via FTP And Stop There?
It’s totally possible to bulk upload files via FTP without completing any additional steps. The problem only arises if you want those files to be available inside your WordPress media library.
See, once you upload a file via FTP, it’s live on your server. That is, you could link to it directly and the file would load. But while you can link directly to the file, it won’t appear in your WordPress media library unless you complete a few additional actions to register the uploaded file with WordPress.
So if you want the files you bulk upload to actually appear in your media library, you need to complete the following process:
- Upload the files to your uploads folder via FTP
- Use a free WordPress plugin to register the files you uploaded with your WordPress media library
Below, we’ll take you through all of the steps in detail. You don’t need any specialized knowledge to complete the process – just follow along with the screenshots!
How to Bulk Upload Files to WordPress Media Library
In order to bulk upload your files to the WordPress media library, you’ll need a few tools and pieces of information:
- The FTP account details for your host – we’ll show you how to find these for your Kinsta account. If you’re using a different host, you’ll need to get those details from your own hosting dashboard.
- An FTP program – a piece of software that allows you to upload files to your host. FileZilla is a good free option, but you can pick another FTP program if you’d prefer.
- Add From Server plugin – this free plugin helps you to register your uploaded files to your media library.
Step 1: Connect to Your Website via FTP
To get started, you’ll need to connect to your site via FTP or SFTP. SFTP is just short for Secure FTP. Kinsta exclusively uses SFTP, but some other hosts operate on FTP still.
Remember – you’ll need an FTP program to do this. We’ll use FileZilla in our screenshots, but you can use a different FTP program if you’d like.
To actually connect, you’ll need your FTP login details (specifically SFTP for Kinsta). If you’re using Kinsta, you can find these details by going to the Sites tab in your Kinsta dashboard. Then, click the Manage button next to the site you’d like to upload files to:
Manage WordPress site in Kinsta
Then, you should see your details under SFTP/SSH. You’ll need all three pieces of information (Username, Password, Port):
SFTP login information
Now, you have all the information you need to connect via FTP. If you’re not using Kinsta, you should be able to get this same information from your host.
Armed with your SFTP details, go back to your FTP program and enter them as follows:
- Host – your actual domain name preceded by “sftp://”. For example: sftp://www.yoursite.com. Additionally, some FTP programs allow you to specify the SFTP method in a separate dropdown. You can view a guide for such programs here.
- Username – from your Kinsta dashboard
- Password – from your Kinsta dashboard
- Port – from your Kinsta dashboard
Filezilla login via SFTP
Once you’ve entered the information, click the Quickconnect button and FileZilla (or your FTP program of choice) will handle the rest.
Step 2: Upload As Many Files As You’d Like
At this point, you should be connected to your site via FTP. You can confirm this by looking for the Status: Connected to yoursite.com message:
Connected with Filezilla FTP client
Now, you need to upload your files to the uploads folder in your WordPress site. To do that, expand the folder structure of your Remote Site tab in your FTP program by clicking the + buttons. You can see the file path to follow in the screenshot below:
Expanding FTP folders
Now, you can navigate to the files you’d like to upload in the Local Site tab of your FTP program. All you need to do is drag those files from the Local Site side to the Uploads folder in your Remote Site:
Upload local files via FTP
Depending on the size of your files, it might take some time for them to upload. But other than waiting for the uploads to complete, you’re now finished with this step.
Step 3: Register Your Newly Uploaded Files to the WordPress Media Library
Once the FTP uploads finish, your files are live on your server. But if you go to your WordPress site’s media library, you’ll notice that the files are nowhere to be seen:
WordPress media library
To bring those files into your library, you need to install and activate the free Add From Server plugin.
Once the plugin is activated, you can navigate to Media → Add From Server. Then click the uploads folder in the list:
Add From Server WordPress plugin
Now, you should see a list of the files you just uploaded via FTP. Assuming you want to import every single file, you can just tick the checkbox to Select All (if not, you can always select individual files). Then, click the Import button at the bottom:
Add From Server – select files
After clicking the button, you should see a success message for each individual file at the top of your screen:
Adding media library folders via FTP
And when you go back to your media library, you should see all of the files you uploaded via FTP:
FTP files show in WordPress media library
That’s it! You’re done at this point. That’s all you need to do to bulk upload files to your WordPress media library. (recommended tutorial: 4 Handy WordPress Media Library Hacks)
Here are a few alternatives you could also use to bulk upload and register files within your WordPress media library.
- If you’d like a plugin with a little more complex functionality, you can try the free Media from FTP plugin. The main advantage of this plugin is the ability to schedule the import process to run automatically. Unless you specifically need this functionality, though, it’s generally safer to stick with the manual approach offered by Add From Server whenever possible.
- You can also use the premium WP All Import plugin to import images from your server.
- If you want to do it straight from the command line you can import images using WP-CLI. The wp media import command allows you to create attachments from local files or URLs.