Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

135
Views
only access with url which I write on htaccess prevent accessing real url

I have folder admin
And I have changed url from admin to admin-cdn with below rule

RewriteRule ^admin-cdn/?(.*)$ admin/$1 [L]

Now I can access admin folder's files with both www.domain.com/admin/ and www.domain.com/admin-cdn/ url

I want show 404 error when user what to access with www.domain.com/admin path

How can do this in .htaccess file

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

You can do it like this:

RewriteEngine On

# if /admin/ is entered as URL then send 404
RewriteCond %{THE_REQUEST} \s/admin[?/\s] [NC]
RewriteRule ^ - [L,R=404]

# internal rewrite from /admin-cdn/ to /admin/
RewriteRule ^admin-cdn(/.*)?$ admin$1 [L,NC]
over 4 years ago · Santiago Trujillo Report

0

Try this

RewriteRule ^admin/ - [L,R=404]
RewriteRule ^admin-cdn/?(.*)$ admin/$1 [L]
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!