IIS
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationIIS

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old August 2nd, 2004, 06:31 PM
jcfriedly jcfriedly is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 3 jcfriedly User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Problem with creating 301 redirect

I am using PHP on an IIS 6.0 server and am trying to give users a 301 "Moved Permanently" http header for many thousands of files that were mistakenly put in the wrong place. Instead of 301, I get a 302 status ("Moved Temporarily") from my server.

The PHP code I am using to create what should be a 301 redirect is extremely simple and repeated ad nauseum on the web. I have run the code by some PHP forums with various people saying I am doing it correctly and there is no solution forthcoming. I dare say I may have discovered a bug in PHP since this exact same bug was in an earlier version, although it was supposedly fixed. Maybe the bug was only fixed for some web servers like Apache but somehow doesn't work in IIS 6.0 - I don't know.

So my question is, is there some other way I can get my IIS server to return a 301 code? If I was using Apache, I gather, I would simply make a bunch of changes to my .htaccess file, redirecting on a file-by-file or folder-by-folder basis. The problem is that it's not just a few files but many many thousands of files in hundreds of different directories.

For some of the directories, all there are in there are files that need redirection. So in those directories, I can "fool" my IIS into believing that my .php files really require Perl to operate (by selecting folder properties from within IIS and configuring my execute permissions) and then I simply replace my PHP scripts with Perl scripts which do, thankfully, produce the 301 redirect status I need.

But this little trick cannot be used when the old .php files are in directories that also contain legitimate .php files since I would have to convert even my legitimate, non-redirected .php scripts into Perl scripts.

So my question is, first does anyone know how to solve this PHP-IIS problem? If not, can you think of a work-around like the one I'm trying with Perl? Is there some IIS equivalent to .htaccess that allows a file-by-file redirection?

Thanks for your help.

Reply With Quote
  #2  
Old August 4th, 2004, 03:09 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,713 Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 4 Weeks 1 Day 23 h 57 m 59 sec
Reputation Power: 688
You can set up custom error pages and maybe do what you want there, but I'm only guessing.
__________________
======
Doug G
======
"Hide, hide witch! The good folk come to burn thee. Their keen enjoyment hid behind their gothic mask of duty." -Mark Clifton

Reply With Quote
  #3  
Old August 4th, 2004, 03:36 PM
jcfriedly jcfriedly is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 3 jcfriedly User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by Doug G
You can set up custom error pages and maybe do what you want there, but I'm only guessing.


Doug, I think you may be on to something. I thought of that but didn't think it would work. Now I'm rethinking the problem and will give a report back after I've tested a few things.

Reply With Quote
  #4  
Old August 5th, 2004, 08:11 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,713 Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 4 Weeks 1 Day 23 h 57 m 59 sec
Reputation Power: 688
Good luck, this is foreign territory for me

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationIIS > Problem with creating 301 redirect


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway