Redirect /zm alias to server's root

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
Rajstopy
Posts: 20
Joined: Fri Sep 13, 2019 3:52 pm
Location: Paris

Redirect /zm alias to server's root

Post by Rajstopy »

Dear all,

I've a strange f*ù^! problem I'm struggling with for a while.

When accessing ZoneMinder, I need to put https://myserver.net/zm . I just want to be able to type https://myserver.net. Looks easy but when I change the DocumentRoot to /usr/share/zoneminder/www , I get some strange layout meaning something is not set correctly. What would be the best approach to use my server's root address ?

Cheers,

R.
pms
Posts: 11
Joined: Sat Aug 24, 2019 3:59 pm

Re: Redirect /zm alias to server's root

Post by pms »

If you wan to login using url https://myserver.net
you can create an "index.php" file in the root redirecting pointing to the zm directory.

index.php content:

<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: https://myserver.net/zm");
header("Connection: close");
?>
Rajstopy
Posts: 20
Joined: Fri Sep 13, 2019 3:52 pm
Location: Paris

Re: Redirect /zm alias to server's root

Post by Rajstopy »

Great !

Will try it asap and let you know.

Many thanks,

R.
User avatar
kitkat
Posts: 193
Joined: Sun Jan 27, 2019 5:17 pm

Re: Redirect /zm alias to server's root

Post by kitkat »

This worked for me...

Code: Select all

mount --bind /usr/share/zoneminder/www /var/www/html
To make it survive a reboot, do...

Code: Select all

echo "/usr/share/zoneminder/www /var/www/html auto bind,defaults 0 0" >> /etc/fstab
I'm running ZM-1.32.2 on CentOS/Apache so if you're using something different then you may have to alter the paths above.
Rajstopy
Posts: 20
Joined: Fri Sep 13, 2019 3:52 pm
Location: Paris

Re: Redirect /zm alias to server's root

Post by Rajstopy »

Hello,

I did install the index.php permanent redirect. It works fine !

Cheers,

R.
Post Reply