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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:27:17+00:00 2026-06-12T02:27:17+00:00

I accessed a ‘superfolder’s .htaccess file and accidentally added Rewrite / http://google.com/ This was

  • 0

I accessed a ‘superfolder’s .htaccess file and accidentally added

Rewrite / http://google.com/

This was done using php. Now I can’t access php files in any directory to revert the change.

Is there anything I can do in a subdirectory of root to stop the redirect inside that folder?

Thank you.

And please don’t ask more details about the ‘accident’.. stupid mistake

  • 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-12T02:27:19+00:00Added an answer on June 12, 2026 at 2:27 am

    I contacted server admin, both laughed at it.. Still interesting though how to stop it redirecting although it shouldn’t happen if I use mod_rewrite.

    With mod_alias’ Redirect, you’re screwed. That directive is applied across the board, starting from the path-node where the htaccess file sits (if it’s in an htaccess file), or the path-node of the <Directory> block that it sits in. So the only solution is to get an admin to remove it.

    With mod_rewrite however, with an htaccess file, it doesn’t act the same as within a <Directory> block. Rules inside an htaccess file in a path-node inside a directory has precedence over rules inside an htaccess file in the parent directory. So if you had 2 htaccess files:

    /.htaccess:

    RewriteEngine On
    RewriteRule ^/? http://google.com/
    

    and in /tmp/.htaccess:

    RewriteEngine On
    RewriteRule ^/?tmp/ http://stackoverflow.com/
    

    And you go to http://yourdomain.com/tmp/, you’ll get redirected to http://stackoverflow.com/ because the rules in the tmp directory has precedence over the rules in the parent directory. In face, the rules in the parent directory aren’t applied at all unless you’ve used the RewriteOptions Inherit directive to inherit any rules from the parent directory.

    Because of this, you can simply create an htaccess file with the following:

    RewriteEngine On
    

    Use FTP to upload it to your subdirectory, and upload the php file that you used to change the parent directory’s htaccess file. Then just use your browser and go to that php file in the subdirectory.

    Having simply turned on the rewrite engine in your subdirectory, without any rules, means:

    1. I have mod_rewrite active in this directory
    2. Since the rewrite engine is turned on in this directory, ignore all rules in the all parent directories.
    3. Since the mod_rewrite ruleset is blank (no actual RerwiteRule‘s) nothing happens at all
    4. Accessing this directory, eventhough the rewrite engine is on, mod_rewrite does nothing so it’s as if the rewrite engine is turned off.

    Sounds counter-intuitive, but that’s just how it works.

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

Sidebar

Related Questions

I have a site that can be accessed both through http (http://mysite.com) and https
From JSP file accessed another JSP file which acts like java class, this used
Say I have a remote page accessed through http://www.mypage.com/test.aspx . On that page I
I have a url now that is accessed like: http://s1.name.com/healthApp I want it to
I have a page that is accessed via a URL like this: http://power-coder.net/Test/something.php?id=3#Page1 I
Static fields are being accessed using the class name like this: public class Me()
When using the 'Remove not accessed field' quick fix option from the ReSharper context
Resource files in Silverlight can be accessed using the code below: ResourceManager rm =
I just inherited this code which is accessed by multiple threads. I just introduced
The Netbeans Go To File feature (accessed with shift+alt+o) is extremely slow compared to

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.