Enjoy unlimited access to all forum features for FREE! Optional upgrade available for extra perks.

When not to use .htaccess

Status
Not open for further replies.

Charles Sweeney

Level 5
Legacy Exclusive Member
Joined
Apr 11, 2012
Messages
283
Reaction score
55
Apache advise "in general, use of .htaccess files should be avoided when possible". This is for performance and security reasons.

Source: http://httpd.apache.org/docs/2.2/howto/htaccess.html#when

The reason I am posting this is because a lot of people seem to use an access file (commonly named .htaccess but can be named anything) as a matter of routine.

I've got my own servers so always configure the main Apache config file but I appreciate others are on shared hosting and can't do that, but I would seriously consider if you need to use the .htaccess file at all. A lot of the stuff is either a waste of time or can be achieved by other means (redirects in PHP for example).

The performance hit would be the biggest concern for me.
 
Dynadot - Expired Domain Auctions

Preciousmetals

Level 3
Legacy Gold Member
Joined
Apr 15, 2012
Messages
69
Reaction score
1
Rewrites with PHP or meta tags will negatively affect your SEO.. 99% of webmasters won't have access to the configuration file of the server unless your hosting your server or using a host that allows more access than usual.

I would not want to see a website redirect DOMAIN.com to WWW.DOMAIN.COM using any other methods besides the htaccess file.
Again goes for 404 pages, You can create a custom 404 page but unless you setup your htaccess files your going to get redirected
to whereever your host wants your customer to go, Usually a sales page for your hosting company.

There probably is new and effective ways around old school issues, But I like to stick to the roots.
 

Charles Sweeney

Level 5
Legacy Exclusive Member
Joined
Apr 11, 2012
Messages
283
Reaction score
55
I do all that with PHP. I would advise people to take Apache's own advice. Using PHP to redirect and serve a 301 as opposed to using Apache (.htaccess) won't make a blind bit of difference to bots but it will make your site quicker and less vulnerable to security risks.
 

katherine

Country hopper
Legacy Exclusive Member
Joined
Jul 9, 2005
Messages
8,427
Reaction score
1,290

Nomzo

Level 5
Legacy Exclusive Member
Joined
Nov 23, 2007
Messages
483
Reaction score
2
How scalable are individual 301 redirects with PHP?

Say you have a website with 10,000 URLs to migrate, would you have the flexibility with PHP that Regex and htaccess offers?
 

Mark Talbot

Level 7
Legacy Platinum Member
Joined
Jun 13, 2003
Messages
931
Reaction score
164
I suppose if I am not getting a million hits a day on my websites, then the added server load shall be minimal at best. Bt I use htaccess on all my sites for various reasons, but for all practical purposes, it is the most effective, effecient, and safe way considering the applications and intents. Yes, maybe it can be done via your suggestion apache config, but alas, I shall stick with what works, hasnt proven unsafe, and is not such a burdon to my server.
 
Status
Not open for further replies.

Who has viewed this thread (Total: 1) View details

Who has watched this thread (Total: 3) View details

The Rule #1

Do not insult any other member. Be polite and do business. Thank you!

Members Online

Sedo - it.com Premiums

IT.com

Premium Members

MariaBuy

Upcoming events

New Threads

Our Mods' Businesses

UrlPick.com

*the exceptional businesses of our esteemed moderators

Top Bottom