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 8149643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:53:39+00:00 2026-06-06T14:53:39+00:00

I am trying to rewrite a url so that all requests for /admin get

  • 0

I am trying to rewrite a url so that all requests for /admin get a 404 except for admin/special_page and admin/another_special_page etc.

I think I need some regex magic to help, but I’m not sure?!

Thanks all

  • 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-06-06T14:53:40+00:00Added an answer on June 6, 2026 at 2:53 pm

    Please try to write this in your .htaccess-file:

    RewriteEngine On
    RewriteCond %{REQUEST_URI} /admin
    RewriteCond %{REQUEST_URI} !/admin/special_page
    RewriteCond %{REQUEST_URI} !/admin/another_special_page
    RewriteRule ^ - [R=404,L]
    

    The first RewriteCond blocks every request to the “admin”-folder, the other two conditions exclude the two special pages. The RewriteRule will not change the URL but create a 404-error

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to match any requests for a url that do not have a
I have been trying to get the IIS URL Rewrite engine to work for
I'm trying to make user friendly URL using mode rewrite. My problem is, that
I am trying to rewrite a URL with .htaccess and had a question that
I'm trying to rewrite a url of this: http://www.foo.com/bar/baz to index.php?q=$1&d=baz Where bar is
I am trying to rewrite a URL using .htaccess. I am running on Apache
I am trying to rewrite this url: http://www.sample.com/product_guide&product_name=waht&product_type=dog-clipper to: http://www.sample.com/waht/dog-clipper I am using this
I'm trying to rewrite some query strings I have in my URL like this
I am trying to make a generic URL rewrite methods, and i want it
So I am trying to redirect all image requests from my server to use

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.