Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Old 11-26-2005, 02:17 PM redirect question
Yak Yak Yak Yak Yak

Posts: 593
Location: Rochester, MN
Trades: 0
I am building an archive of news articles. The articles are cached in a directory with many others. When that directory becomes too full, I would like to relocate some of the older articles to another location. However, I need users and spiders to be taken to the new location when the files are moved.

I know I can do this with .htaccess, but here is my dilema. The directory that holds the cached files, also holds the news script, and the cacheing script. I am using mod_rewrite in the .htaccess file. I don't really want to alter that .htaccess file, for fear of causing problems with the mod_rewrite.

I am also concerned that the .htaccess option would slow down the site if it became too large.

So, here is my question.

Is there a way to do a 301 redirect without using the .htaccess file?
__________________

Please login or register to view this content. Registration is FREE
neorunner is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-27-2005, 08:02 AM
someguy's Avatar
Extreme Talker

Posts: 151
Location: UK
Trades: 0
.htaccess files have to get pretty big before they start making an noticeable impact on the site, so don't rule that method out too early.

However, it is easy to redirect without using .htaccess. You just need to send the right information through the header. Here is an example using PHP:


Just put the following code in the old page
Code:
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.whereverthenew/fileis.php");
Hope that's helpful
someguy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to redirect question
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.28259 seconds with 12 queries