Nov 21, 2009
Pages: 1, 2

.htaccess Help

free web hosting

Read Latest Entries..: (Post #11) by tansqrx on Feb 9 2009, 10:10 PM.
You may want to refer to http://www.astahost.com/Internal-Redirects-t18270.html for more information. I had a similar problem and finally got a solution.
Read the FIRST post of this Topic. - Express your Opinion! Contribute Knowledge :-).

Open Discussion & Free Web Hosting > Computers & Tech > Internet and Websites

.htaccess Help

FirefoxRocks
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?

Comment/Reply (w/o sign-up)

toby
You could use DirectoryIndex in each htaccess, or something like this in the root dir. Redirect ^/*/$ / 301

Comment/Reply (w/o sign-up)

FirefoxRocks
I'm sorry but I don't understand what you are saying. Could you please tell me what to put in the .htaccess file?

Comment/Reply (w/o sign-up)

CheckProgs
QUOTE(FirefoxRocks @ Oct 12 2008, 10:54 AM) *
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.

Comment/Reply (w/o sign-up)

FirefoxRocks
Wouldn't that redirect ALL directories to the root directory? I just want to redirect one, not all directories.

Comment/Reply (w/o sign-up)

toby
Then this.

Redirect ^/bladir/$ /blafile.php 301

Comment/Reply (w/o sign-up)

FirefoxRocks
That code only gave me an internal server error (HTTP 500). I tried 302, 301 and 410 and it still does the same thing.

Comment/Reply (w/o sign-up)

yordan
QUOTE(FirefoxRocks @ Oct 14 2008, 03:12 PM) *
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 ?

Comment/Reply (w/o sign-up)

FirefoxRocks
This is my .htaccess file:
CODE
Redirect /xkingdom http://feral.portal.trap17.com/
Redirect ^/wdl/$ /gone.php 301

The first line works, the second line doesn't. It actually returns an Internal Server Error:
QUOTE
Internal Server Error
The 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.

Comment/Reply (w/o sign-up)

toby
Try the number after the first line as well.

Comment/Reply (w/o sign-up)

Latest Entries

tansqrx
You may want to refer to http://www.astahost.com/Internal-Redirects-t18270.html for more information. I had a similar problem and finally got a solution.

Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Pages: 1, 2

See Also,

*SIMILAR VIDEOS*
Searching Video's for , htaccess
advertisement



.htaccess Help

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com