Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Bad pages redirection

# Redirection to HTTPS
RewriteCond     %{SERVER_PORT} ^80$
RewriteRule     ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]

This rule is in the wrong place. It needs to go before the # BEGIN WordPress comment marker. ie. Before the WordPress front-controller.

Currently, this will result in a redirect to /index.php if requesting HTTP.

# BEGIN SecuPress hotlink
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteCond %{REQUEST_FILENAME} \.(jpg|jpeg|png|gif)$ [NC]
</IfModule>
# END SecuPress

And this block is incomplete/wrong. Unless you know the missing directives, this block must be deleted.

Fortunately, it’s “only” making the next RewriteRule (in the WordPress code block) superfluous, but it could potentially break your site.

Related Posts:

  1. 404.php only works if I’m logged in. Everybody else redirects to wp-login.php – why?
  2. Check if wp-login is current page
  3. Private pages that work when you are not logged into WP admin
  4. Associate Page with User
  5. htaccess modify headers IF url ends with “news”
  6. How to redirect login and register pages
  7. List all private pages user has access rights to read
  8. How to redirect a page to another?
  9. Can’t locate a hidden private page
  10. How to update the counter of private pages in the dashboard?
  11. Could be a namespace conflict (?) with login form and register form on the same page
  12. How to control who can view certain pages in BuddyPress? [closed]
  13. Edit page shown after login in WordPress?
  14. logout redirect only from admin page
  15. get_permalink not fetching correct pages
  16. Folder wordpress page redirect
  17. How to rewrite a page url
  18. Custom page only editable by one user
  19. How to hide a page in wordpress made for menu
  20. Pages in wp-admin is not found 404
  21. WordPress redirects to login page when I enter url.com/index.php
  22. Sup pages can’t be found
  23. Maximum number of characters in a wordpress page?
  24. Make wordpress pages accessible for Woocommerce logged in users only
  25. Post id(login page) not found
  26. Have subdirectory name act as $_GET or $_POST data
  27. How can a user login on a wordpress page?
  28. Add infinite scroll to content splitted post
  29. How to get current page ID outside the loop?
  30. Contact Form on WordPress Sites?
  31. Page returns 404 with POST variables, but not without
  32. Custom templates not showing up in template dropdown
  33. Get page id by template
  34. Using pre_get_posts on true pages and static front pages
  35. Get the content of a specific page (by ID)
  36. How to get page title with the page ID?
  37. Show more than 20 items in pages or posts edit dashboard
  38. Allowing user to edit only certain pages
  39. How to display last 3 posts (recent posts) in a static page?
  40. How to give paged links custom title?
  41. How to set post slug when using wp_insert_post();?
  42. How can I keep the content of my pages version controlled?
  43. How to load javascript on custom page template?
  44. How to configure WordPress to handle 75,000 pages?
  45. How to update page status from publish to draft and draft to publish
  46. Check if is on child-page of a particular page
  47. Change page template programmatically ?
  48. Conditional tag to check if ‘page.php’ is being used?
  49. Customizing the URLs of WordPress Login and Sign-up Pages?
  50. How to disable posts and use pages only
  51. featured image as background image on pages
  52. Check IF is a “single product page” and Check the “role” for a Redirect
  53. A check for if is parent page, if has children, if has grandchildren
  54. How to load JS and CSS only on specific Pages using is_page()?
  55. How do I require authorization / login to view a specific set of posts / pages?
  56. Listing pages which uses specific template [duplicate]
  57. Proper way to get page content
  58. Access the same page from multiple urls (wildcard)
  59. Create a page without adding a page in the Database
  60. Is there a way to change the default page template selection?
  61. Can I have two child pages of different parents with the same name?
  62. What methods to use to create small, editable pieces of text for static pages?
  63. Show Default Editor on Blog Page ( Administration Panel )
  64. Hide page visual editor if certain template is selected?
  65. What is the difference between $paged and $page?
  66. multi page password protection
  67. Create a “Dummy” parent page for a hierarchy in page listing?
  68. How do I convert a page’s title to lower case?
  69. Get top level page parent title
  70. How to add a specific widget to only 1 page?
  71. Restrict admin access to certain pages for certain users
  72. page title, parent tilte and grand parent title
  73. How to add jQuery script to an individual page?
  74. WordPress page edit does not save selected template
  75. Add a Page without header and menus?
  76. What is an alternative to get_page_by_title()?
  77. Password protect page with multiple passwords
  78. Create pages automatically if they don’t exist
  79. Find empty pages or pages which have less than x characters
  80. Allow only new sub-pages to be created
  81. Set page template automatically based on parent
  82. how to display the wordpress login and register forms on a page?
  83. Editing Complex Pages in Visual Mode
  84. Link section within page with slash (/) and not hash (#) without reloading the page
  85. Creating a template using a specific slug name, for a page with a parent page
  86. Can I display submenus in groups, using wp_list_pages?
  87. Is there a default template file for child pages / subpages?
  88. Get wp_get_attachment_url outside of loop
  89. Order by menu_order and title?
  90. Require title for pages
  91. WP Page and Subdirectory with same name
  92. Replace Dashes Before Title in Page List
  93. Add a new page to wordpress programmatically
  94. Get Permalink for the top level parent of child pages
  95. Proper method to restrict non logged users into certain pages
  96. How to redirect on particular page in wordpress? [closed]
  97. Get page id by title?
  98. What is the use of $page_title and how to use it?
  99. How to embed page content in a blog post
  100. Passing variables through permalink structure
Categories pages Tags .htaccess, login, pages, private
Is there a way to globallly apply esc_html( … ) to all inputs and anchors to filter out XSS markup?
How Change WordPress header image from admin menu

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress