Thread: PHP Redirect
View Single Post
02-26-2007, 09:19 PM
#15
RaZoR^ is offline RaZoR^
RaZoR^'s Avatar
Status: Member
Join date: Feb 2006
Location:
Expertise:
Software:
 
Posts: 191
iTrader: 1 / 100%
 

RaZoR^ is on a distinguished road

  Old

Redirecting from the web server is the best option, not redirecting from a module installed on the web server. This takes up less resources and if I'm not corrected, a very small amount of bandwidth will be kept from this

JavaScript is a bad option. A lot of the users here will probably have JS enabled because they are designers and such and won't be up for using text-based browsers. In the interest of accessibility, Internet Explorer uses who turn off scripting and other users who don't like client-side scripting enabled, you should avoid using JavaScript where you can.

The same goes for Meta Refreshing. The page has to first be loaded, and if you come across a user with a strict browser, it may not render the page properly without making it HTML/XHTML compliant. This would be even more of a waste of bandwidth, server resources and because users would have to wait for the page to load, resources, bandwidth and time of your users.

Assuming you're buying from a clever server host using Apache, then the following would just be slapped into the .htaccess file in your root folder:

Code:
DirectoryIndex /wordpress/index.php
This actually sets the directory's index page to the directory you've stored your wordpress blog in It's not a redirect as such, but I didn't think being correct with HTTP headers would be very significant. If you want to be correct on this, in the same file you would have put the above in, put:

Code:
Redirect permanent /index.html /wordpress/
Just create a file called index.html, leave it blank, put it in the root directory, the above in .htaccess in the root directory and you're laughing.

(Sorry for jabbering on)