short url for SERVER

Discussion in 'Installation/Configuration' started by pawan, Aug 9, 2010.

  1. pawan

    pawan Member

    Dear All,
    Can I access http://server1.example.com:8080 by creating an alias or URL redirect like admin.example.com etc.

    I think it will be more convenient for the customers to login to the account by easy URL.

    Regards
    Pawan Joshi
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

  3. HyperAtom

    HyperAtom New Member

    Till, I've read through a load of documentation for the mod_rewrite module but can't figure out how to do it for a port such as :8080.

    Also, must the module be set in httpd.conf?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The rules should work for ports as well. e.g.

    Code:
    RewriteCond %{HTTP_HOST}   ^admin.example.com [NC]
    RewriteRule ^/(.*)         http://server1.example.com:8080/ [L,R]
    No. It is lready enabled.
     
  5. pawan

    pawan Member

    short URL

    Dear Till,
    Thanks for the detailed explanation by example.

    Though I have not tried it, I have another question that is say I have five domain created in ISPCONFIG.

    I can access ISPCONFIG control panel login from anydomain.tld:8080 that is any five domains with :8080. is it ok.
     
  6. HyperAtom

    HyperAtom New Member

    Must I write Tills example in the website options box?
     
  7. HyperAtom

    HyperAtom New Member

    Okay Im really tearing my hair out with this one.

    Im using the code:

    RewriteEngine on
    RewriteRule ^/admin$ %{HTTP_HOST}:8080/ [R]

    which of course doesn't work because it takes me to the url
    http://mydomain.com/mydomain.com:8080

    How can i get rid of the first part so im left with domain.com:8080?
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Please see my example above. You are currently redirecting to a path and I'am redirecting to URL in my example.
     
  9. HyperAtom

    HyperAtom New Member

    Hmm still cant get it to work.

    I tried

    RewriteCond %{HTTP_HOST} ^domain.ath.cx/admin [NC]
    RewriteRule ^/(.*) domain.ath.cx:8080/ [L,R]

    could you please point out what im doing wrong?

    I dont want a subdomain, just a directory to redirect.
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    You entered a path as redirect target but you have to use a URL. A URL starts with http://. So your rewrite rule has to be a URL like this:

    RewriteRule ^/(.*) http://domain.ath.cx:8080/ [L,R]
     
  11. HyperAtom

    HyperAtom New Member

  12. pawan

    pawan Member

    short URL

    Dear Till,

    Please tell if the ISPCONFIG CONTROL PANEL access vide any domain created in ISPCONFIG with :8080 is ok or is there any thing wrong.

    Second the example you have shown for rewrite, in which file I need to insert that code. is it "ispconfig.vhost" or do i need to insert in website options for all the websites created in ispconfig.

    Regards
     
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    The controlpanel should always be accessed trough the server hostname and not a client Domain.
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    Do not change the rewrite condition, I posted you a different rewriteRule and not a different condition. Rewrite conditions may not contain http://.
     
  15. pawan

    pawan Member

    short URL

    I am able to access control panel from any clientdomain:8080.

    I am running ispconfig 3.0.3

    I have just changed the SSL engine to off.

    I have set the internal ip 192.168.0.10 for the server1.example.com as well as same internal ip for other client domains.

    I have set external ip for all domains in DNS records.

    Now where I should look for to correct the situation. Though it is ok for me, if it doesn't create any problem or break the server.
     
  16. pawan

    pawan Member

    short URL

    Can I access the server directly at port 80.

    if yes, how. can I change the same in ispconfig.vhost.
     
  17. till

    till Super Moderator Staff Member ISPConfig Developer

    Only if you have a dedicated controlpanel server in a multiserver enviroment that does not host any websites.
     
  18. pawan

    pawan Member

    short URL

    I have added this in example.com's apache directive in options tab

    RewriteCond %{HTTP_HOST}^admin.example.com [NC]
    RewriteRule ^/(.*)http://server1.example.com:8080/ [L,R]

    but I am getting the "server not found error".

    Do I need to add admin in DNS and create sub-domain admin for example.com.

    I have replaced the example.com for mydomain.
     
  19. till

    till Super Moderator Staff Member ISPConfig Developer

    1) Have you created a DNS A-Record for admin.example.com that points to the IP of the website?
    2) Have you added admin.example.com as subdomain to the website example.com?
    3) You missed several whitespaces in the condition and rule.
     
  20. HyperAtom

    HyperAtom New Member

    Sorry to bother you again till but I still cant seem to get it working, this time i will post screen shots.

    [​IMG]
    [​IMG]

    I want to browse to mydomain.ath.cx/admin to be redirected to mydomain:8080.
     

Share This Page