Skip to main content
Share Your Experience: Take the 2024 Developer Survey
28 votes
Accepted

How does WordPress create URLs that Apache knows about?

Actually there is no communication happening between Apache and WordPress. The "magic" is happening in Apache mod_rewrite rules. For a standard WordPress installation, you have the following rules in ...
Fayaz's user avatar
  • 8,917
11 votes
Accepted

Does the debug.log do log rotation?

No, it creates only one file. There is no log rotation involved. But... Sometimes “but” can be a good thing ;) WP uses error_log for its debug log, so you can change its location using: ini_set( '...
Krzysiek Dróżdż's user avatar
5 votes
Accepted

Which Apache-modules must I enable?

Here is the list of minimum Apache modules which is required to run WordPress websites. mod_alias mod_authz_host mod_deflate mod_dir mod_expires mod_headers mod_mime mod_rewrite mod_log_config ...
Nefro's user avatar
  • 648
5 votes

Why won't Wordpress on localhost find updates?

First Open /wp-config.php Now the first thing you need to do is to open the wp-config.php file from your WordPress root folder, the file is located at wordpress/wp-config.php Insert FS_METHOD Paste ...
naveenos's user avatar
  • 151
5 votes

What's the proper way to setup WP-CLI on Ubuntu so that I don't have to use the flag --allow-root?

All files and folders should be owned by www-data user and group if not then WordPress can't change files hence fails to update from dashboard. wp-cli says to use sudo -u www-data -i -- wp <command&...
Sangam's user avatar
  • 151
5 votes

How to run multiple Async HTTP requests in Wordpress?

The (built-in) Requests class lets you call multiple requests simultaneously: Requests::request_multiple. <?php $requests = Requests::request_multiple([ [ 'url' => 'https://www....
alpipego's user avatar
  • 356
5 votes
Accepted

REST API URL parameters not working with apache server

You’re using the wrong endpoint. Look at the documentation. id is not one of the parameters for the posts endpoint. The correct way to retrieve a post with the ID of 1 is: /wp-json/wp/v2/posts/1
Jacob Peattie's user avatar
5 votes
Accepted

cURL 28 error after switch from to brew php 7.2 on localhost

Try This First: Your Problem Might Be DNS In my testing this is a problem with DNS resolving. In my case it's because the DNS filter/cache I run on my local network wasn't responding to requests. ...
John B's user avatar
  • 346
4 votes
Accepted

WordPress V2 REST-API: Endpoints 404?

Try changing your permalinks structure. Within the dashboard go to Settings > Permalinks and select the Post Name structure. When this is done click Save Changes. If Post Name is already selected,...
Marc's user avatar
  • 721
4 votes

authentication issue with rest api - rest_cannot_create

Authorization header is usually stripped by Apache. You can fix it with .htaccess RewriteEngine On RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
mrbarletta's user avatar
4 votes

authentication issue with rest api - rest_cannot_create

If you are here because you have already tried everything and still can't create resources via Wordpress Rest API, then let me share what worked for me. First of all, let me give you some context ...
Antony Fuentes's user avatar
4 votes
Accepted

Hardening WordPress - how to set .htaccess permissions?

It might be useful to let the web server write .htaccess during initial site setup, e.g. when you're setting up rewrite rules (as it said) or if you're setting up a multisite network. Once you've done ...
Rup's user avatar
  • 4,277
3 votes

Unable to modify(update) posts - Page not found

there's no guaranteed solution from me but a few point may help you towards the solution. 1: double check your .htaccess file. and paste below code into it. # BEGIN WordPress <IfModule ...
Anwer AR's user avatar
  • 1,007
3 votes
Accepted

WordPress refuses to read the .htaccess file and gives a 404 for sub-pages

Even though the 000-default.conf file had... <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html <Directory /var/www/html/> ...
ckhatton's user avatar
  • 153
3 votes

Wordpress redirecting to 127.0.0.1 when accessing the site from a remote device

Maybe your case was different from mine, but I want to share with you how I fixed this issue, hoping will be useful for other people. In my case the issue was caused by All In One Wordpress Security ...
Diego D's user avatar
  • 131
3 votes

VB.net and WordPress

So I'm wondering if anyone might know how I could use VB.net for my calculators on my Wordpress website. Directly? No, you can't run .Net in a browser, and the closest available is silverlight and ...
Tom J Nowell's user avatar
  • 59.4k
2 votes

Wordpress redirecting connections on port 8080 to 80

Same problem. In my situation, I set the server port at 3030, to accommodate other servers. Anyway, without having to add any code to any functions.php files, I solved the problem by changing the site ...
seebiscuit's user avatar
2 votes

How does one suppress a 404 status code in a WordPress page?

Take a look at the pre_handle_404 hook (added in v4.5.0): https://developer.wordpress.org/reference/hooks/pre_handle_404/ // add to your functions.php add_filter('pre_handle_404', function($preempt, $...
Jonathan MacDonald's user avatar
2 votes
Accepted

Unable to modify(update) posts - Page not found

If you have access to remote MySQL, this MIGHT help you. I've done this a while ago when i had another issue with my hosting provider. Take a full backup of your WordPress files, but not your ...
Johansson's user avatar
  • 15.3k
2 votes

Best practices for making a WordPress site "movable"?

Moving a WordPress website is fairly easy, here are the steps: Backup your mysql database and re-import it in the new environment, Move all the files to the new environment, Update the wp-config.php ...
rayrutjes's user avatar
  • 121
2 votes

What's the proper way to setup WP-CLI on Ubuntu so that I don't have to use the flag --allow-root?

first of all you need to fix so you're allowed to login as www-data if that's what you want to do. Otherwise you can do this as root. If you're logged in as root, add to your shell (i.e. /root/....
Kentur's user avatar
  • 29
2 votes

How to redirect only 404 pages with htaccess in Wordpress

As far I understand, .htaccess rewrite rules are executed before the request is proccesed by WordPress, or even by PHP engine, so you can not know if a URL will trigger a 404 error in .htaccess, you ...
cybmeta's user avatar
  • 20.5k
2 votes
Accepted

.htaccess 301 vs. 302 Enforcing HTTPS

The different .htaccess/mod_rewrite directives you see around are usually because of differences in the server configuration (nothing to do with WordPress) and where they are being used. There's no ...
MrWhite's user avatar
  • 3,881
2 votes

How does WP work in conjunction with a web server?

Apache only runs the index.php of WordPress, and serves static files (images, css, js etc). WP does all the rest, including parsing the request to find out what content to show the user. Apache does ...
janh's user avatar
  • 2,738
2 votes
Accepted

WordPress on VirtualBox - no pretty permalinks

... and as per usual, I figure it out as soon as I post the question -.- Using this answer, I changed apache2.conf under /etc/apache2/. There is a section towards the bottom talking about the ...
Quin's user avatar
  • 21
2 votes
Accepted

Rewrite /?rest_route=/ link to /wp-json/ without changing default permalink structure in apache

Solved by this lines: RewriteEngine On RewriteBase / RewriteRule ^wp-json/(.*) /?rest_route=/$1 [L]
Daler's user avatar
  • 91
2 votes
Accepted

Permalinks not working Apache + CentOS 7

For the next person, be sure to set AllowOverride All in the correct directory. In Damon's case he set AllowOverride All in the /var/www/html directory, but his site is located in /var/www/example.com/...
Brad Poulton's user avatar
2 votes

Wordpress redirecting to 127.0.0.1 when accessing the site from a remote device

You can add the config below to wp-config define('WP_HOME','http://example.com'); define('WP_SITEURL','http://example.com'); Or update the value in database at wp_options table. The settings of url ...
Hồ Trọng Linh Ân's user avatar
2 votes

Exclude a path from WordPress using .htaccess redirects (Apache)

You should use RewriteCond instead of RewriteRule. Use this: RewriteCond %{REQUEST_URI} !/foo/ So, for example, the full code could be like this: # BEGIN WordPress <IfModule mod_rewrite.c> ...
T.Todua's user avatar
  • 5,800
2 votes
Accepted

Exclude a path from WordPress using .htaccess redirects (Apache)

One small hiccup is that you'll need to update RewriteRule ./ in that second to last line. Here is an updated (and tested) snippet for you: # BEGIN WordPress <IfModule mod_rewrite.c> ...
ChristopherJones's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible