Register a domain and help support LQ
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 06-15-2003, 10:47 PM   #1
LQ Newbie
Registered: Jun 2003
Posts: 21

Rep: Reputation: 0
Exclamation Apache rewrite question

I would like to redirect any url which doesn't have to

For example: -->
but, -->

I hope that make sense, and i hope there are apache guru's out there who can help me. I need this solution for multiple domains so not specific solution.

Thanks in advance.

Last edited by CrazyToon; 06-16-2003 at 04:26 AM.
Old 06-16-2003, 08:35 AM   #2
Registered: Mar 2003
Location: Washington DC, USA
Distribution: Redhat
Posts: 212

Rep: Reputation: 30
Are you trying to host several different sites on the same sever without multiple I.Ps? Is so you must create virtual hosts for each site and then add the I.P address and host name to your etc/hosts file. A virtual host looks like this (add these to your httpd.conf file, change the domain names to your sites names, change the document root to the directories you wish:

<VirtualHost *>
DocumentRoot /www/domain

<VirtualHost *>
DocumentRoot /www/otherdomain

After you have done that, add these names to your hosts file, and give them the same I.P. adress. For instance if the name is and the i.p adress is, your hosts file would look like this

Apache will route to the proper site depending on the URL, you can host several different sites on the same box with the same I.P address. kind of like Host Headers in IIS.

Last edited by bentman78; 06-16-2003 at 08:37 AM.
Old 06-16-2003, 08:58 AM   #3
Senior Member
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
Check out the URL Rewriting Guide on the Apache website. It's in the docs section for the 1.X branch.
Old 06-17-2003, 03:00 PM   #4
LQ Newbie
Registered: Jun 2003
Posts: 21

Original Poster
Rep: Reputation: 0
Thanks for responses.

I am using mass virtual hosting format. and i tried reading the url rewriting guide but its beyond my skillset unfortunately.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with Apache rewrite rules?? latino Programming 0 12-24-2004 03:09 AM
apache proxy server rewrite urls slackwarefan Linux - Software 0 10-19-2004 08:58 PM
Help me make this rewrite rule in Apache ganninu Linux - General 8 01-07-2004 09:30 AM
apache mod rewrite Robert0380 Linux - Software 5 07-31-2003 05:42 PM
Apache Rewrite Not Working mikeyt_333 Linux - General 1 05-20-2003 06:00 PM

All times are GMT -5. The time now is 08:46 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration