logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: htaccess redirect
Author
magace



Joined: 09 Oct 2014
Posts: 2
Location: austin

PostPosted: Thu 09 Oct '14 17:09    Post subject: htaccess redirect Reply with quote

Hello can anyone help creating a basic redirect. I tried using a bunch of examples I found online with no luck. Sad

What I need is to redirect the root of my server 173.x.x.x to a file called test.php in the root of my folder.
example: when I go to http://173.x.x.x I get redirected to http://173.x.x.x/test.php

Thanks for viewing!
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Fri 10 Oct '14 4:22    Post subject: Reply with quote

You really do not need a redirect for this. By default the server will look for what is configured as the DirectoryIndex when no file is specified. Just add to the htaccess

DirectoryIndex test.php
Back to top
magace



Joined: 09 Oct 2014
Posts: 2
Location: austin

PostPosted: Fri 10 Oct '14 4:25    Post subject: Reply with quote

Thanks that works like a charm!
Back to top
Chiba



Joined: 10 Oct 2014
Posts: 1
Location: Germany

PostPosted: Sat 11 Oct '14 3:54    Post subject: Reply with quote

Hi, i got a 500 error witch cause me to create a topic in this forum just because i don't have enough knowledge in redirects. Redirects are just bad, because for my case i get 500 error when i accidentally redirect to a sub directory that redirect also to the root so it is confusing a bit. Very Happy
Redirects should be avoided to the maximum, and glsmith answer is correct and clean.
Back to top


Reply to topic   Topic: htaccess redirect View previous topic :: View next topic
Post new topic   Forum Index -> Apache