Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know tittle is horrible, but couldn't find a way to explain it in few words.

My problem is following...

Server domain is -

I setup subdomain with CNAME on my hosting server. -> ->

So trac/svn url is:

I want to shorten urls to just and

How do I do this? what are my options?

(unfortunately I was told it is not possible to put path in CNAME, otherwise I would just make point to

1 define way I could think of myself is using virtual hosts and just using different port for svn and trac. But I wonder if there are more solutions.

share|improve this question
up vote 3 down vote accepted

Updated (after reading the question more carefully)

In your httpd.conf file...

...make sure a line similar to the following appears (note, if you've got one of the newer Linux distros they do a crazy/half-braindead directory linking scheme to enable and disable modules, you'll have to consult the documentation for your distro if that's the case).

LoadModule rewrite_module   libexec/apache22/

...then, somewhere later in the file, you should have some sort of organization/structure where you group similar directives together, put lines similar to this:

<IfModule rewrite_module>
    RewriteEngine on

    RewriteCond %{HTTP_HOST}
    RewriteRule (.*) /trac$1

    RewriteCond %{HTTP_HOST}
    RewriteRule (.*) /svn/repos$1


If you have anything else on the Apache server you haven't mentioned, this will likely break that.

share|improve this answer
cant I just do RewriteRule on -> /trac/ -> /svn/repos/ but only if user arrives through subdomain? – Sandro Dzneladze May 11 '12 at 13:22
Updated... Sorry, didn't read the question close enough. – Chris S May 11 '12 at 13:56
1. this will only make sense if the OP is not using vhosts. 2. the OP should use vhosts, and set the documentroot properly. All these rewrites are unnecessary. – adaptr May 11 '12 at 13:59
@adaptr 1. He's made no indication that he is using vhosts, I'm not responsible for giving an incorrect answer if the information provided is incorrect. 2. Write your own answer. – Chris S May 11 '12 at 14:12
Due to reasons I don't want to disclose I cannot use nhosts, mod_rewrite solution is perfect for me. – Sandro Dzneladze May 11 '12 at 14:33

You can create two virtual host (and it is possible to use the same port) in combination with mod_rewrite.

share|improve this answer
can you give me precise pointers? thanks! – Sandro Dzneladze May 11 '12 at 12:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.