redirect redhat home page to another link

Hello Experts,

I am not so familiar with Apache.  How to redirect Apache home page to another URL link under same server like (http://127.0.0.1:9195).  I did some search it recommed using (mod_rewrite), but don't know how to use it.

thanks
uknet80Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

xtermCommented:
This should work - try it out, and let me know if it needs tweaking

RewriteEngine On
RewriteRule ^/(.*)     http://%{HTTP_HOST}:9195/$1 [R]

You can put it in the .htaccess file, or in the VirtualHost for that site.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
uknet80Author Commented:
I have located it at the end of httpd.conf file, and it worked thanks.  by default .htaccess doesn't exist, can you tell me where to created that file under /var/www/. and how its basic structure will be?





0
xtermCommented:
For a .htaccess file it literally needs nothing other than the rule itself, and you put the file in the DocumentRoot of the vhost which will make it recurse for all directories below it.

The only thing you need to remember about that is that for the directory you put it in, you need to tell Apache to honor .htaccess in that folder using AllowOverride in the Directory definition.  You can use All, or to narrow it down, FileInfo should work too (in your AllowOverride directive)
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

uknet80Author Commented:
DocumentRoot is located under /var/www/error/, I moved the file .htaccess to that folder.
There are several AllowOverride under httpd.conf file, which one shall i change to All? most of them are none
0
xtermCommented:
Change the one for /var/www/error
0
uknet80Author Commented:
thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.