Make WordPress Core

Opened 6 years ago

Closed 11 months ago

#46792 closed defect (bug) (invalid)

CPANEL Directory Privacy DoesNOT work With WordPress Admin Directory

Reported by: ephremfirew's profile ephremfirew Owned by:
Milestone: Priority: normal
Severity: blocker Version: 5.1
Component: Security Keywords: needs-testing reporter-feedback
Focuses: Cc:

Description (last modified by SergeyBiryukov)

Hello WordPress,

Protecting my wordpress admin directory using CPANEL Directory privacy feature doesn't work.

And I tried to replace the default wordpress rule in htaccess file:

# 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>

Replaced with this by adding another / after Dot:

RewriteRule ./ /index.php [L]

IT WORKS 100%

But the problem is:

When I update the permalinks, it will rewrite the default rules again.

What is the solution?

Change History (5)

#1 follow-up: @mcmwebsol
6 years ago

Have you tried adding it before the "# BEGIN WordPress" line?
Or you could set .htaccess to be read-only (e.g. 444 permissions).

#2 in reply to: ↑ 1 @ephremfirew
6 years ago

Duplicating the rule will damage the website stylesheets. Blocking with 444 may prevent other security plugin tasks but I will try it.

#3 @SergeyBiryukov
6 years ago

  • Description modified (diff)

#4 in reply to: ↑ description @SergeyBiryukov
6 years ago

  • Keywords reporter-feedback added; needs-patch removed

Hi @ephremfirew, welcome to WordPress Trac! Thanks for the report.

Protecting my wordpress admin directory using CPANEL Directory privacy feature doesn't work.

Could you clarify the exact issue with that feature and provide the steps to reproduce it?

Replaced with this by adding another / after Dot:

RewriteRule ./ /index.php [L]

What's the purpose of that change? As you've noticed, any changes inside # BEGIN WordPress ... # END WordPress can be overwritten. If you need custom rewrite rules, they should be added outside of that block.

#5 @hellofromTonya
11 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Given it's been 5 years without follow-up, I'll close it, assuming the issue was resolved.

Hello @ephremfirew,

Does this issue still happen for you today?

  • If no, woohoo!
  • If yes, please reopen this ticket and reply to Sergey's questions. This kind of information helps contributors diagnose and reproduce. Thank you.
Note: See TracTickets for help on using tickets.