Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Subscribe to HRA Now!


Are you a Google Analytics enthusiast?

Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE! 




From the folks who brought you High Rankings!

- - - - -

Need Htaccess To Rewrite Subdirectory Up One Level

  • Please log in to reply
No replies to this topic

#1 TeamSDA


    HR 1

  • Members
  • Pip
  • 2 posts

Posted 23 April 2013 - 07:12 PM

Hey Everyone,
We are having an issue with our htaccess file. Our goal is to get the pages in a subdirectory to be viewed in the URL as if it were up a level. For example:

Our files are located in :



Naturally it would reflect on the web as:


But we want it to rewrite as:

  • Keep in mind if someone were to manually:
  • We would need the htaccess to force write: 
Currently we have the following in our htaccess:
RewriteEngine on
RewriteCond %{THE_REQUEST} ^GET\ /([^.\ ]+\.)+php(\?[^\ ]*)?\ HTTP
RewriteRule ^(.+)\.php$ <http://www.domain.com/subfolder/$1> [R=301,L]


For the most part our htaccess is doing it’s job. The only issue we are having is that it is stripping the php extensions off of all our pages. We need the extensions to remain there for technical reasons.
As of right now, when we manually enter:
The htaccess forces it to be re-written to:
How do we stop it from excluding our extensions? Just to clarify, it is functioning perfectly for what we want except for the fact that it is excluding our page extensions. Are we going about this correctly or is there a better way of accomplishing this. Any kind of help would be greatly appreciated.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

We are now a read-only forum.
No new posts or registrations allowed.