Results 1 to 18 of 18
  1. #1
    Join Date
    Aug 2002
    Posts
    655

    Redirect domain.com/admin to https://domain.com:10000

    How do i forward requests to http://www.domain.com/admin to https://www.domain.com:10000 ?

    I have usermin control panel running at https port 10000, but hosted customers have trouble rememembering the port address, hence i want to provide simplified url to all hosted customer so that whenever a customer types http://domain.com/admin or http://www.domain.com/admin he is forwarded to https://www.domain.com:10000 .

    I have a number of domains hosted and need a global mod_rewrite rule or whatever that can be specified once in my apache httpd.conf file and it should work for all hosted domains on my server.

  2. #2
    I just pasted the below in another thread, you can use it for your situation as well:

    Just make a default document like index.html or default.html

    <html>
    <head>
    <meta http-equiv="refresh" content="0; URL=http://www.domain.com:10000/">
    </head>
    </html>
    Caro.Net: Support is everything
    Offering High Quality Dedicated Servers.

  3. #3
    Join Date
    Apr 2003
    Location
    San Jose, CA.
    Posts
    1,624
    you could do that... or

    put in a .htaccess file, or as you mention in your httpd.conf to have it work "globally":

    Redirect /admin https://www.domain.com:1000

  4. #4
    Join Date
    Aug 2002
    Posts
    655
    how do i do this with just one global entry in httpd.conf?

    i want this to work in following manner;
    - domain1.com/admin should forward to https://www.domain1.com:10000
    - domain2.com/admin should forward to https://www.domain2.com:10000

  5. #5
    Join Date
    Dec 2004
    Location
    New York, NY
    Posts
    10,710
    MediaLayer, LLC - www.medialayer.com Learn how we can make your website load faster, translating to better conversion rates for your business!
    The pioneers of optimized web hosting, featuring LiteSpeed Web Server & SSD Storage - Celebrating 10 Years in Business

  6. #6
    Join Date
    Sep 2006
    Location
    UK
    Posts
    61
    You can also do forwards in php:

    <?php
    header("Location: http://domain.com:8080");
    ?>

    I realise this will cause an infinate loop if your forwarding to the same page, just refer to it from a different page

    Regards
    Chris Priestland
    Host Centric
    www.host-centric.co.uk
    Host Centric is part of the JMF Group which has been provisioning web hosting since 2003

  7. #7
    Join Date
    Oct 2004
    Location
    Kerala, India
    Posts
    4,771
    You can use mod_proxy in apache to redirect the requests coming to port 80 to port 10000
    David | www.cliffsupport.com
    Affordable Server Management Solutions sales AT cliffsupport DOT com
    CliffWebManager | Access WHM from iPhone and Android

  8. #8
    Join Date
    Aug 2002
    Posts
    655
    Quote Originally Posted by david510
    You can use mod_proxy in apache to redirect the requests coming to port 80 to port 10000
    I do not want to direct all port 80 requesys to port 10000.

    Instead i want to direct all requests coming on port 80 as www.domain.com/admin to secure port https://www.domain.com:10000

    Can you let me know how to do this using mod_proxy?

  9. #9
    Join Date
    Aug 2006
    Location
    Western Europe
    Posts
    217
    Quote Originally Posted by hostchamp
    I do not want to direct all port 80 requesys to port 10000.

    Instead i want to direct all requests coming on port 80 as www.domain.com/admin to secure port https://www.domain.com:10000

    Can you let me know how to do this using mod_proxy?
    You need to enable mod_proxy from apache (mostly just uncommenting). Then just add this in your httpd.conf configuration file.

    <VirtualHost SOMEIP:80>
    ServerName SOME.hostname.tld|
    ProxyRequests Off
    ProxyPass /admin http://localhost:10000/
    ProxyPassReverse /admin http://localhost:10000/
    </VirtualHost>
    or just the 3 Proxy[...] line to an existing virtualhost.

  10. #10
    Join Date
    Aug 2002
    Posts
    655
    Quote Originally Posted by Dualism
    You need to enable mod_proxy from apache (mostly just uncommenting). Then just add this in your httpd.conf configuration file.



    or just the 3 Proxy[...] line to an existing virtualhost.

    how do i do this with just one global entry in httpd.conf?

    i want this to work in following manner;
    - domain1.com/admin should forward to https://www.domain1.com:10000
    - domain2.com/admin should forward to https://www.domain2.com:10000

    I do not want to enter this for each virtualhostblock as i have lots of virtual domains.

  11. #11
    Join Date
    Aug 2002
    Posts
    655
    anyone pls?

  12. #12
    Join Date
    Aug 2006
    Location
    Western Europe
    Posts
    217
    Quote Originally Posted by hostchamp
    anyone pls?
    I am not thinking deeply about, but yes you must add to each virtualhost. For sure you can find a workaround to don't do it so, but at this time, I don't find it.

    Are you using a control panel ? Is yes, which one, some can rewrite all files with only 2-3 shell commands.

  13. #13
    Join Date
    Aug 2002
    Posts
    655
    i do not use any control panel, i jst use webmin

  14. #14
    Join Date
    Aug 2006
    Location
    Western Europe
    Posts
    217
    Quote Originally Posted by hostchamp
    i do not use any control panel, i jst use webmin
    So yes you must rewrite all.

  15. #15
    Join Date
    Aug 2006
    Location
    Western Europe
    Posts
    217
    I just got a little workaround solution.

    Add an alias to your global httpd.conf like :

    Alias /adminpanel /var/www/html/adminpanel.php
    and

    <VirtualHost 111.111.111.111:80>
    ServerName www.yourspecialhostname.net
    ProxyRequests Off
    ProxyPass / http://localhost:10000/
    ProxyPassReverse / http://localhost:10000/
    </VirtualHost>
    and then you create the file "adminpanel.php" in /var/www/html/ and inside you add some code like :

    <?php
    header("Location: http://www.yourspecialhostname.net");
    ?>
    So that way, when some type http://www.mywebsite.com/adminpanel he's forwarded to -> /var/www/html/adminpanel.php this file open your special hostname and get where you wanted.

  16. #16
    Join Date
    Aug 2002
    Posts
    655
    you got this slightly wrong, i do not want domain1.com/admin or
    domain2.com/admin to forward to https://yourspecialhostname.com:10000

    instead i want this to work in following manner;
    - domain1.com/admin should forward to https://www.domain1.com:10000
    - domain2.com/admin should forward to https://www.domain2.com:10000

    basically whateverdomaincustomertypes.com/admin should be redirected to https://whateverdomaincustomertypes.com:10000

    i.e. on the browser address bar the url should be https://www.customersowndomain.com:10000

  17. #17
    Join Date
    Aug 2002
    Posts
    655
    you got this slightly wrong, i do not want domain1.com/admin or
    domain2.com/admin to forward to https://yourspecialhostname.com:10000

    instead i want this to work in following manner;
    - domain1.com/admin should forward to https://www.domain1.com:10000
    - domain2.com/admin should forward to https://www.domain2.com:10000

    basically whateverdomaincustomertypes.com/admin should be redirected to https://whateverdomaincustomertypes.com:10000

    i.e. on the browser address bar the url should be https://www.customersowndomain.com:10000

  18. #18
    You have to use a rewrite rule in .htaccess file under admin/ directory, like

    RewriteCond &#37;{HTTP_HOST} (^.*$)
    RewriteRule .* https://%1:10000/ [R=301]
    LiteSpeed Web Acceleration Platform by https://www.litespeedtech.com
    Apache drop-in replacement. Triple server capacity with 10X performance increases.
    Ultimate web serving platform for WordPress, Magento and other web applications.
    Turbo charging all WordPress sites hosted on your server with a single click!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •