Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
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.
| |
|
Topic: htaccess redirect |
|
Author |
|
magace
Joined: 09 Oct 2014 Posts: 2 Location: austin
|
Posted: Thu 09 Oct '14 17:09 Post subject: htaccess redirect |
|
|
Hello can anyone help creating a basic redirect. I tried using a bunch of examples I found online with no luck.
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
|
Posted: Fri 10 Oct '14 4:22 Post subject: |
|
|
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
|
Posted: Fri 10 Oct '14 4:25 Post subject: |
|
|
Thanks that works like a charm! |
|
Back to top |
|
Chiba
Joined: 10 Oct 2014 Posts: 1 Location: Germany
|
Posted: Sat 11 Oct '14 3:54 Post subject: |
|
|
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.
Redirects should be avoided to the maximum, and glsmith answer is correct and clean. |
|
Back to top |
|
|
|
|
|
|