Changing default landing URL

Topics including remote access and management can go here, including port forwarding, telnet, ssh, and advanced network settings.
Forum rules
This is a user forum for Synology users to share experience/help out each other: if you need direct assistance from the Synology technical support team, please use the following form:
https://myds.synology.com/support/suppo ... p?lang=enu

Changing default landing URL

Postby MrGlass » Tue Apr 24, 2012 10:26 am

Hi All,

Not sure if this is the right forum to post but here's what I'm trying to do.

I have my domain DNS redirected to my static IP. My router then redirects this to the synology box.
http://thisis.my.domain.com now successfully redirects through to the synology.

HOWEVER... at the moment it then automatically redirects through to the login page (5000/5001).
I would like it to automatically go to port 80 for the wordpress or even better.. to go to the Photostation as default.

Is this possible?

Gavin
PS: please advise if there is a better board to post this to.
MrGlass
Novice
Novice
 
Posts: 40
Joined: Mon Sep 20, 2010 12:06 pm

Re: Changing default landing URL

Postby jokemeister » Sat Apr 28, 2012 11:10 am

Your domain should be coming thru on port 80 so getting the DSM login which is on port 5000 doesn't make sense. I assume you have enabled the web station and you're not forwarding port 80 to 5000?
Regards, Jokemeister
DS211J DSM 4.1-2668 2 x 2TB Seagate + 2TB Samsung USB
DGN3500 Netgear Router/Modem
DLink DGS1016D 16 port Gigabit Switch
Netgear GS105 5 port Gigabit switch
WDTVLive x 3
PC x 2 LAN
Laptop x 2 WiFi
Blackberry WiFi
iPad x 4 WiFi
iPhone x 3 WiFi
iPod x 3 WiFi
PS2 x 2
xbox360
....and a partridge in a pear tree.
User avatar
jokemeister
Versed
Versed
 
Posts: 262
Joined: Sat Dec 03, 2011 10:58 pm

Re: Changing default landing URL

Postby henkg » Sat Apr 28, 2012 11:33 am

The URL to use is http://my-IP/photo or http://my-IP/wordpress.
http://my-IP will go to your root web share. If it doesn't find a index.html/index.htm/index.php there, it will redirect to the DSM login.
DS412+. 1x WD20EFRX + 3x HD204UI, SHR (RAID5). DSM 4.2-3211.
DS210j. 2x HD203WI, RAID1. DSM 4.2-3211.
Router Netgear WNDR3700. Switch TP-Link TL-SG1008D. AcRyan Mini v1. UPS APC BE700G-GR. Ipcam Edimax IC-3010.
henkg
Enlightened
Enlightened
 
Posts: 426
Joined: Sat Sep 25, 2010 8:16 am
Location: Netherlands

Re: Changing default landing URL

Postby MrGlass » Sat Apr 28, 2012 11:46 am

Exactly... That's what I am trying to change. I want default to be photo, and have to put in HTTP://syn/admin to be the one I need to specify.. Any ideas?
MrGlass
Novice
Novice
 
Posts: 40
Joined: Mon Sep 20, 2010 12:06 pm

Re: Changing default landing URL

Postby myCloud » Sat Apr 28, 2012 1:13 pm

Don't know if this will work, but have you tried an index.html in your root webshare that redirects to the URL you want, along with a subdirectory named admin with an index.html that redirects to port 5000?
DS 1512+ w/3GB, 5 x 3TB Seagate ST3000DM001 8.2TB RAID 6, half files/half Time Machine.
Icy Dock MB559U3S-1SB enclosure w/4TB Hitachi UltraStar via USB 3 for files backup
UVERSE to AirPort Extreme + 2 AirPort Express w/speakers. TRENDnet TV-IP312WN camera
CyberPower CP1500PFCLCD Sine Wave UPS
DSM 4.1-2661 w/SSH + SFTP, VPN Server, Syslog Server, Media Server, Mail Server, Mail Station,
Audio Station, Surveillance Station, Photo Station, Web Station - DS Apps on iPad & iPod Touch.
User avatar
myCloud
Skilled
Skilled
 
Posts: 648
Joined: Fri Mar 23, 2012 11:28 am

Re: Changing default landing URL

Postby henkg » Sat Apr 28, 2012 4:37 pm

Put (something like) this index.php in your web root, where xyz1 is your photostation hostname and xyz2 your wordpress hostname. If you only need a redirect to photostation, omit the second IF {}:
Code: Select all
<?php
    IF ($_SERVER["SERVER_NAME"] == "xyz1.dyndns.org") {
       header("Location: photo");
    }
     IF ($_SERVER["SERVER_NAME"] == "xyz2.dyndns.org") {
       header("Location: wordpress");
    }
       ELSE {
       echo "Error: SERVER_NAME = " . $_SERVER["SERVER_NAME"];
    }
 ?>
DS412+. 1x WD20EFRX + 3x HD204UI, SHR (RAID5). DSM 4.2-3211.
DS210j. 2x HD203WI, RAID1. DSM 4.2-3211.
Router Netgear WNDR3700. Switch TP-Link TL-SG1008D. AcRyan Mini v1. UPS APC BE700G-GR. Ipcam Edimax IC-3010.
henkg
Enlightened
Enlightened
 
Posts: 426
Joined: Sat Sep 25, 2010 8:16 am
Location: Netherlands

Re: Changing default landing URL

Postby rcblackwell » Thu May 10, 2012 4:13 pm

henkg wrote:Put (something like) this index.php in your web root, where xyz1 is your photostation hostname and xyz2 your wordpress hostname. If you only need a redirect to photostation, omit the second IF {}:
Code: Select all
<?php
    IF ($_SERVER["SERVER_NAME"] == "xyz1.dyndns.org") {
       header("Location: photo");
    }
     IF ($_SERVER["SERVER_NAME"] == "xyz2.dyndns.org") {
       header("Location: wordpress");
    }
       ELSE {
       echo "Error: SERVER_NAME = " . $_SERVER["SERVER_NAME"];
    }
 ?>


I'm trying to implement this script using two domain names; mydomain1.com and mydomain2.com. Both are directed to my IP via DDNS services. I'd like the firts domain to point to my existing website which is setup as a virtal host on the DS and and second domain to point to "Photostation". I believe I understand the script but don't know which folder the resulting (index.php) file should be located in. Should it placed in the "Web" folder? If so, where do I point the virtual host that's currently set-up on the DS?
Robert Blackwell
Pickering, Ontario
User avatar
rcblackwell
Student
Student
 
Posts: 79
Joined: Sun May 16, 2010 12:20 pm
Location: Pickering, Ontario

Re: Changing default landing URL

Postby henkg » Thu May 10, 2012 4:33 pm

The index.php file should be in the web root (/volume1/web), because thats where the request is looking for an index file.
Can't help you with virtual hosts. I do not use them, and in fact I do not understand virtual hosts yet.
DS412+. 1x WD20EFRX + 3x HD204UI, SHR (RAID5). DSM 4.2-3211.
DS210j. 2x HD203WI, RAID1. DSM 4.2-3211.
Router Netgear WNDR3700. Switch TP-Link TL-SG1008D. AcRyan Mini v1. UPS APC BE700G-GR. Ipcam Edimax IC-3010.
henkg
Enlightened
Enlightened
 
Posts: 426
Joined: Sat Sep 25, 2010 8:16 am
Location: Netherlands

Re: Changing default landing URL

Postby MrGlass » Fri May 11, 2012 11:07 am

Thanks everyone for this.. I'm going to try it out on the weekend.
MrGlass
Novice
Novice
 
Posts: 40
Joined: Mon Sep 20, 2010 12:06 pm

Re: Changing default landing URL

Postby rcblackwell » Sat May 12, 2012 2:03 pm

henkg wrote:The index.php file should be in the web root (/volume1/web), because thats where the request is looking for an index file.


After updating the script with my information then placing it in the web root I'm pleased to say this solution is working great. Thank you very much.


Can't help you with virtual hosts. I do not use them, and in fact I do not understand virtual hosts yet.


Prior to implementing this script I wondered if an existing virtual host entry would be in conflict. As part of my testing, all entries previously made in the "Virtual Host" dialog box were removed. With the script implemented, instruction within it successfully directs users to the appropriate website thus it appears there isn't a need for “Virtual Host” entries.
Robert Blackwell
Pickering, Ontario
User avatar
rcblackwell
Student
Student
 
Posts: 79
Joined: Sun May 16, 2010 12:20 pm
Location: Pickering, Ontario

Re: Changing default landing URL

Postby cyclop » Sat Jun 23, 2012 5:22 pm

Hi All,

I use this script to redirect hostnames to specific folders. It works perfectly. However, I would like to know if there is any way to hide the folder name which appear after the domain name in the address bar (e.g. http://www.mydomain.com/myfolder) when I connect to my sites?
Thank you for your reply.

Cyclop
cyclop
I'm New!
I'm New!
 
Posts: 4
Joined: Sun Aug 08, 2010 4:31 pm

Re: Changing default landing URL

Postby HarryPotter » Sat Jun 23, 2012 6:36 pm

Yes it is possible. Use virtual hosts instead of the index file with redirection code.
*Please do not Private Message me for support questions; leave it on the forum so all members can learn. Thanks!*

DS712+ / DSM 4.2 3211 / 2 x HD204UI (RAID0) / LMS 7.7.2-007
DS110+ / DSM 4.2 3211 / HD154UI
DS408 / DSM 4.0 2228 / 3 x ST31000340AS (RAID0) + 1 x HDS721010KLA330
DS207+ / DSM 3.1.1636 / ST31000340AS + WD5000KS
DS-106x / DSM 4.0 2228 (from DS108j) /

2 Squeezebox 3 + Boom
Rapsody N35

APC Smart UPS SUA750i
User avatar
HarryPotter
Honorary Moderator
Honorary Moderator
 
Posts: 12347
Joined: Mon Oct 23, 2006 12:48 pm
Location: Switzerland

Re: Changing default landing URL

Postby cyclop » Sat Jun 23, 2012 8:17 pm

Thank you for your reply HarryPotter. I use this script instead of virtual hosts because I need to redirect one of my domain name directly to photo station... Any ideas?
Thanks.
cyclop
I'm New!
I'm New!
 
Posts: 4
Joined: Sun Aug 08, 2010 4:31 pm

Re: Changing default landing URL

Postby HarryPotter » Sun Jun 24, 2012 5:26 pm

You can edit the file

/usr/syno/etc/httpd-vhost.conf-user

With

Code: Select all
NameVirtualHost *:80
<VirtualHost *:80>
 ServerName your1.server.com
 DocumentRoot /var/packages/PhotoStation/target/photo
 </VirtualHost>
<VirtualHost *:80>
 ServerName your2.server.com
 DocumentRoot /var/services/web/folder2
 </VirtualHost>
<VirtualHost *:80>
 ServerName your3.server.com
 DocumentRoot /var/services/web/folder3
 </VirtualHost>

you should get what you want

Dont forget to restart apache after each changes:

Code: Select all
/usr/syno/etc.defaults/rc.d/S97apache-user.sh restart



Easiest way is to add all your virtual hosts with DSM user interface. For PhotoStation add an entry too (for example with folder "photo". Then edit the file and change the DocumentRoot for photo to the one above.
*Please do not Private Message me for support questions; leave it on the forum so all members can learn. Thanks!*

DS712+ / DSM 4.2 3211 / 2 x HD204UI (RAID0) / LMS 7.7.2-007
DS110+ / DSM 4.2 3211 / HD154UI
DS408 / DSM 4.0 2228 / 3 x ST31000340AS (RAID0) + 1 x HDS721010KLA330
DS207+ / DSM 3.1.1636 / ST31000340AS + WD5000KS
DS-106x / DSM 4.0 2228 (from DS108j) /

2 Squeezebox 3 + Boom
Rapsody N35

APC Smart UPS SUA750i
User avatar
HarryPotter
Honorary Moderator
Honorary Moderator
 
Posts: 12347
Joined: Mon Oct 23, 2006 12:48 pm
Location: Switzerland

Re: Changing default landing URL

Postby cyclop » Mon Jun 25, 2012 9:03 pm

Many thanks for your help.
cyclop
I'm New!
I'm New!
 
Posts: 4
Joined: Sun Aug 08, 2010 4:31 pm

Next

Return to Remote Access and Network Management

Who is online

Users browsing this forum: No registered users and 5 guests