Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6044967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:04:21+00:00 2026-05-23T07:04:21+00:00

I have a WordPress deployment and I want to ignore all external accesses to

  • 0

I have a WordPress deployment and I want to ignore all external accesses to resources that exists (i.e. files and directories) but I want to accept all internal redirects. The idea is to not reveal to external users that /wp* exists. I know that I will have to rename wp-content for this to work (as well as tweak some things in wp-config.php, but the bottom line is:

How do I configure my .htaccess file to only accept internal redirects and to ignore all other requests?

I think there’s %{ENV_VAR} somewhere that would let me create a RewriteCond but I couldn’t find it in the apache docs.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T07:04:22+00:00Added an answer on May 23, 2026 at 7:04 am

    I tried both IVA and hakre’s suggested methods. They didn’t work for what I was trying to do. The way that I got this to work was similar to what hakre suggested but instead of defining my own variable I use one that is already defined: %{ENV:REDIRECT_STATUS}. Do something similar to this:

      # If the resource requested is a `wp*` file or directory AND it's NOT from a redirect 
      # (notice that the 'match' is an empty string, poop to a 403.
      RewriteCond %{REQUEST_FILENAME} wp-.*$ [NC]
      RewriteCond %{ENV:REDIRECT_STATUS} ^$
      RewriteCond %{REQUEST_FILENAME} -f [NC,OR]
      RewriteCond %{REQUEST_FILENAME} -d [NC]
      RewriteRule .* - [F,L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a wordpress theme that has a build in shortcode for creating an
I have a wordpress page (Sofa QandA). I want to change the color of
i have an wordpress site and it have menus over there. what i want
I have installed WordPress locally on WampServer for testing purposes. I discovered that when
I have a WordPress blog and I'm trying to make that when a user
I have wordpress site, i added like button for share post. But, i don't
I have a WordPress plug in that I am working on and I seem
I have a WordPress site, in which type1 users can upload *.doc files and
I'm working on a project that runs with WordPress - So, all the project
I have a Wordpress blog on my domain that was set up by a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.