Method for wdcp to set pseudo-static rules for WORDPRESS
Method 1:
If it is nginx+apache, pseudo-static only needs to place the htaccess file in the root directory of wp.
# WordPress starts
RewriteEngine on
#
#Unless you have set up a different RewriteBase before this
#You can delete or uncomment the following code
# RewriteBase directive:
RewriteBase /
#
#If the request is for "/" or has already been written to WP
RewriteCond $1 ^(index.php)?$ [OR]
#or if the request is for image, css, or js files
RewriteCond $1 . (gif|jpg|css|js|ico)$ [NC,OR]
#If the URL points to an existing file
RewriteCond %{REQUEST_FILENAME} -f [OR]
#If the URL points to an existing directory
RewriteCond %{REQUEST_FILENAME} -d
#Then skip rewriting and go straight to WP
RewriteRule ^(.*)$– [S=1]
#Otherwise point to WP to override the request
RewriteRule . /index.php [L]
#
#WordPress ends
Method 2:
location /themes/.*. (html|xml)$ {
return 403;
}
location /mobile {
if (!- e $request_filename) {
rewrite ^/mobile/(.*)$ /mobile/index.php last;
}
}
if (!- e $request_filename) {
rewrite ^(.*)$ /index.php last;
}
Save it as him: wordpress-nginx.conf
© Website copyright and disclaimer
1.[honmau Media] independently owns the copyright of all materials on relevant pages of this website;
2. No one is allowed to copy it without the express written permission of [honmau Media];
3. The articles that do not indicate "honmau Media" on this website are all from the Internet and are only for everyone to learn and refer;
4. If there is any infringement/violation/irregularity, please contact customer service QQ or email to delete it, please understand;
5.[honmau Media] reserves the right to correct, modify and update this statement at any time.legal notice