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! 

 



 

 www.CustomReportSharing.com 

From the folks who brought you High Rankings!



Photo
- - - - -

When Not To Use .htaccess


  • This topic is locked This topic is locked
15 replies to this topic

#16 etzeppy

etzeppy

    HR 2

  • Active Members
  • PipPip
  • 37 posts

Posted 18 March 2007 - 12:52 PM

QUOTE(Ron Carnell @ Mar 17 2007, 06:51 PM) View Post
I'm a little surprised, however, that we haven't yet explored another fairly common alternative.

If you have 200 or more pages in the root that need to be redirected, I think it makes sense to start looking for ways that won't create a large .htaccess file. If they're not in the root, however, I think it makes even more sense to take advantage of the fact that .htaccess is a directory-level option.

You're not stuck with just the one sitting in your root, after all.


Thanks for point out this alternative. In my case, the old pages are in a subdirectory. I intially attempted to use the .htaccess in the subdirectory and got caught in a loop because of a syntax problem. It is amazing that there is so much wrong information about how to do this. I found several sites state flat out that you cannot or should not use .htaccess in subdirectories. I gave up on it too soon.

After you made this suggestion, I figure out why it didn't work for me intially. I didn't realize that I needed to include the subdirectory path in the redirect statement. My old pages were all in a /products/ subdirecty. I incorrectly assumed that the redirect statement in the sub level .htaccess should be:

CODE
Redirect 301 /oldfile.html http://www.mysite.com/newfile.php


That didn't work and I gave up after reading some wrong info. I later found out that I needed to include the subdirecty in my old file path statement. I should have used /products/oldfile.html

In my specific case, I'm still happy with the php parse method. I only have one or two real html pages that rarely get called. All of the other html pages are just redirects. But I can see how the .htaccess method might be a better way to go depending on the specific application.

Thanks again to everyone for help and suggestions.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

SPAM FREE FORUM!
 
If you are just registering to spam,
don't bother. You will be wasting your
time as your spam will never see the
light of day!