Considering you got an Apache server, use this full code in the .htaccess file:
# Block the include-only files.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^wp-admin/includes/ - [F,L]
RewriteRule !^wp-includes/ - [S=3]
RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
RewriteRule ^wp-includes/theme-compat/ - [F,L]
</IfModule>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
As a bonus, I would also add this:
<IfModule mod_autoindex.c>
Options -Indexes
</IfModule>
Related Posts:
- How to show one post different from the rest?
- Display posts side by side with custom query
- active link for most recent post on vertical tabs
- Declare inline background image in functions.php
- Stylesheet won’t load even when linked
- why ignore_sticky_posts in sticky post query
- get_query_var( ‘paged’ ) not working outside of homepage
- get custom post type by tag
- Does tax_query really beats meta_query in all situations?
- Using WP_Query To Get Posts Randomly From today
- How to know which one is the main query?
- WP_Query can’t exclude more than 1 author?
- Finding all results from database within 500 miles of the given latitude and longitude [closed]
- How to order posts by custom WP role?
- posts2posts query using connected_items array issue [closed]
- WP Query and order by particular specified IDs
- Get the post permalink within the loop but without additional DB query
- Display revision if post status is pending
- Meta query field order together with post_date order causes posts without the meta field to be unordered
- How To Remove/hide some specific categories from two different categories widget from sidebar
- WP Query search for attachments and their exact title
- How to add another parameters to WP_Query?
- Excluding Sticky Posts from The Loop and from WP_Query() in WordPress?
- How to display posts month by month?
- Display posts with date wordpress default
- Query different number of posts with different formats in one go
- Extending woocommerce admin product search
- Pagination is broken and I need help fixing it
- Query total number of posts
- How to display a posts 1 year ago with custom WP_Query loop?
- Check on which page specific result exist
- WC displaying products from category
- Loop returning only 1 result
- Fetch posts that match term slug first two letters (wp query)
- How does one perform a sub query with different post types
- Query with search and subscribers only output
- Query Page Content From Theme Options?
- Taxonomy order exception for specific term
- next_post_link / previous_post_link not working with WP_Query
- How to Create a Random List of Child Pages
- Is there a way to make this kind of loop shorter and nicer?
- How to make posts unqueryable/unpublish posts where ACF relationship field is an unpublished post? [closed]
- WP Query ordering on a meta field for posts with a date in the future not ordering by datetime
- Merge 2 custom post type posts and taxonomy terms and sort ascending
- Get all posts with empty meta_value
- Count identical post titles
- get_page meta query not working, maybe a bug?
- Query by date from custom field
- pass parameters through variable to WP_QUERY
- What is wrong with my WP_Query Arguments?
- Query of all pages, including children, ordered by meta key
- specific post is not excluded from the loop
- Unable to paginate a custom page query
- How to change the default post type over the loop?
- How to WP Query custom multiple custom taxonomies?
- Sort posts using multiple custom fields and menu_order in single query?
- get_the_terms has strange result since version 6.0
- How to display posts from custom post type category(custom Taxonomy) wise?
- How to make WPQuery custom post type work in Twig / Timber
- get_posts return only first result
- How to allow a variable with “/” in wordpress url
- How to get taxonomy image attached to a Post Type WordPress
- How to display a post(by id) along with css in a page?
- search multiple keywords with wp_query using one query
- Order posts by tags count?
- update_post_meta performance in a loop woocommerce
- Custom Query Pagination not working on static front page
- Post Template Query with WP_Query?
- Wp Query sort order
- Adding additional taxonomies to wordpress taxonomy page
- why doesn’t this pre_get_posts code work?
- Query Top Set Custom Taxonomy In Given Timeperiod
- Custom taxonomy and query multi conditions
- Best way to Order Post in Home without a plugin
- Retrieving category pages from subcategory returns empty sets
- WP_query issue with no posts
- How to get query results for the next page
- Iterate through ID’s in loop
- Multiple loop for “featured” items returns wrong posts
- Get WP_Query query after execution?
- Query string form $_GET[‘value’] is not working as meta value in wp_query
- query_posts problem – need help
- 294 Queries on Mainpage of WordPress
- Pagination on custom post type not working
- how to fetch post_name from WP_Query using Group by a custom value field
- How to display only top posts of parent categories in loop via WP_Query?
- Empty query on Custom Post Type, using WP_Query or get_posts
- Memory size exhausted when extending WP_Query
- A Depth Like Parameter For “get_posts”
- Search query alteration not working for meta values
- Give attachments an archive page, and exclude unattached ones
- The permalink redirecting to current article on single.php page
- Variations as Single Products [closed]
- Bulk delete comments, foreach loop
- Send a variable with a URL and get a variable with Wp query
- Showing Counts on Comment List with Custom Query
- on attachment.php, how to display previous and next attachment links that follow the same order as a custom WP Query
- loop hierarchical custom post type, child pages only
- I’m trying to get posts under a custom taxonomy but I don’t know what I’m doing wrong here
- WP_query shortcode inside acf Repeater breaks the repeater loop