FirefoxRocks 0 Report post Posted October 12, 2008 I have seen examples for redirecting one file to another using htaccess, redirecting directory structures and other things. However, I want to redirect a directory of files to one file in the root directory. How do I do this?Bare minimum: Send a HTTP 301 status code and redirect the user to a specific page.Optimal task: Send a HTTP 410 status code for the page/resource that the user is trying to access and then redirect the user to a specific page.How do I do this via htaccess or PHP? Share this post Link to post Share on other sites
toby 0 Report post Posted October 12, 2008 You could use DirectoryIndex in each htaccess, or something like this in the root dir. Redirect ^/*/$ / 301 Share this post Link to post Share on other sites
FirefoxRocks 0 Report post Posted October 12, 2008 I'm sorry but I don't understand what you are saying. Could you please tell me what to put in the .htaccess file? Share this post Link to post Share on other sites
CheckProgs 0 Report post Posted October 12, 2008 I'm sorry but I don't understand what you are saying. Could you please tell me what to put in the .htaccess file?He just said it.Use this: Redirect ^/*/$ / 301 In the root directory.Give him credit not me. Share this post Link to post Share on other sites
FirefoxRocks 0 Report post Posted October 12, 2008 Wouldn't that redirect ALL directories to the root directory? I just want to redirect one, not all directories. Share this post Link to post Share on other sites
toby 0 Report post Posted October 13, 2008 Then this.Redirect ^/bladir/$ /blafile.php 301 Share this post Link to post Share on other sites
FirefoxRocks 0 Report post Posted October 14, 2008 That code only gave me an internal server error (HTTP 500). I tried 302, 301 and 410 and it still does the same thing. Share this post Link to post Share on other sites
yordan 10 Report post Posted October 14, 2008 That code only gave me an internal server error (HTTP 500). I tried 302, 301 and 410 and it still does the same thing.Do you mean that you really created a working /blafile.php and the 301 redirect does not work, or do you mean that you don't understand the /blafile thing ? Share this post Link to post Share on other sites
FirefoxRocks 0 Report post Posted October 14, 2008 (edited) This is my .htaccess file: Redirect /xkingdom http://feral.portal.trap17.com/Redirect ^/wdl/$ /gone.php 301The first line works, the second line doesn't. It actually returns an Internal Server Error:Internal Server ErrorThe server encountered an internal error or misconfiguration and was unable to complete your request.Please contact the server administrator, webmaster@portal.trap17.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.More information about this error may be available in the server error log.Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.I have the gone.php file in the root directory of my subdomain. Edited October 14, 2008 by FirefoxRocks (see edit history) Share this post Link to post Share on other sites
toby 0 Report post Posted October 15, 2008 Try the number after the first line as well. Share this post Link to post Share on other sites
FirefoxRocks 0 Report post Posted October 15, 2008 That did not help... Share this post Link to post Share on other sites
tansqrx 0 Report post Posted February 9, 2009 You may want to refer to http://forums.xisto.com/topic/95202-topic/?findpost=1064386335 for more information. I had a similar problem and finally got a solution. Share this post Link to post Share on other sites
iGuest 3 Report post Posted March 7, 2010 htaccess.htaccess HelpI have what I think is some type og bot accessing my website and using a lot of bandwidth.Here's the bot: dc.73.84ae.Static.Theplanet.ComI tried blocking this way in htaccessdeny from dc.73.84ae.Static.Theplanet.Comordeny from 73.84.*.*This a a host and I can't find the IPAny ideas how to block this ??-question by Paul K Share this post Link to post Share on other sites