• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Redirect :8443 secure site with fedora core 2

T

thundercon787

Guest
Hello there.. I'm having some difficulties with this..I'm a webhosting provider that does servers and colocated spaces etc.. I'm trying to do redirects for a customer of mine.on his server..and its probably a stupid thing i'm doing so guys don't laugh too hard...

Here's the scoup... I'm running plesk 7.5 reloaded on fedora core 2 os...

I'm trying to redirect the https://domainname.com:8443 ...

so that when my customer does this...or any of his..

http://domainname.com/control

it will take them to the above https control panel login screen

I deal with alot of customers who like everything simplified..

here is what i have tried so far..

[root@web vhosts]# cd yourwebhosters.com
[root@web yourwebhosters.com]# cd httpdocs
[root@web httpdocs]# ls -al
total 16
drwxr-x--- 3 grubei1111 psaserv 4096 Jan 22 00:21 .
drwxr-xr-x 19 root root 4096 Jan 22 00:21 ..
-rwxr-xr-x 1 grubei1111 psacln 616 Jan 22 00:21 index.html
drwxr-xr-x 2 grubei1111 psacln 4096 Jan 22 00:21 picture_library
[root@web httpdocs]# "su grubei1111;echo "Redirect /control https://www.yourwebhosters.com:8443" >> .htaccess;exit;"
-bash: su grubei1111;echo Redirect: command not found
[root@web httpdocs]#

and after that i was going to chown the user:group .htaccess file to his credentials...

I can do the same command string on a cobalt box... but whenit comes to plesk it doesn't work...

I am also running some microsoft dns servers for him.. (thats what this customer wanted) so if you guys think i can do it via that much easier please let me know..

please email me... [email protected] etc.. thanx

-Mike
 
Try the following command inside the httpdoc directory for the domain you want to redirect:

mkdir <dir name>;chown user:group <dir name>;echo "Redirect /<dir name>/index.html https://domain.com:8443/" > <dir name>/.htaccess
 
Originally posted by cYon
Try the following command inside the httpdoc directory for the domain you want to redirect:

mkdir <dir name>;chown user:group <dir name>;echo "Redirect /<dir name>/index.html https://domain.com:8443/" > <dir name>/.htaccess



Ok i did this see below...

[root@web httpdocs]# chown grubei1111:psacln control;echo "Redirect /control/index.html https://yourwebhosters.com:8443" > control/.htaccess
[root@web httpdocs]# ls -al
total 20
drwxr-x--- 4 grubei1111 psaserv 4096 Jan 22 01:57 .
drwxr-xr-x 19 root root 4096 Jan 22 00:21 ..
drwxr-xr-x 2 grubei1111 psacln 4096 Jan 22 02:05 control
-rwxr-xr-x 1 grubei1111 psacln 616 Jan 22 00:21 index.html
drwxr-xr-x 2 grubei1111 psacln 4096 Jan 22 00:21 picture_library
[root@web httpdocs]# cd control
[root@web control]# ls -al
total 12
drwxr-xr-x 2 grubei1111 psacln 4096 Jan 22 02:05 .
drwxr-x--- 4 grubei1111 psaserv 4096 Jan 22 01:57 ..
-rw-r--r-- 1 root root 61 Jan 22 02:05 .htaccess
[root@web control]# chown grubei1111:psacln .htaccess
[root@web control]# ls -al
total 12
drwxr-xr-x 2 grubei1111 psacln 4096 Jan 22 02:05 .
drwxr-x--- 4 grubei1111 psaserv 4096 Jan 22 01:57 ..
-rw-r--r-- 1 grubei1111 psacln 61 Jan 22 02:05 .htaccess
[root@web control]#

now when you try to surfthe url http://www.yourwebhosters.com/control or http://yourwebhosters.com/control gets a http 404 error.. can't be found.. does this mean i need the index.html there? and if so what do i put in it? etc... i'm sure were really close here ... so far so good..

-Mike
 
Originally posted by thundercon787
Ok i did this see below...

[root@web httpdocs]# chown grubei1111:psacln control;echo "Redirect /control/index.html https://yourwebhosters.com:8443" > control/.htaccess
[root@web httpdocs]# ls -al
total 20
drwxr-x--- 4 grubei1111 psaserv 4096 Jan 22 01:57 .
drwxr-xr-x 19 root root 4096 Jan 22 00:21 ..
drwxr-xr-x 2 grubei1111 psacln 4096 Jan 22 02:05 control
-rwxr-xr-x 1 grubei1111 psacln 616 Jan 22 00:21 index.html
drwxr-xr-x 2 grubei1111 psacln 4096 Jan 22 00:21 picture_library
[root@web httpdocs]# cd control
[root@web control]# ls -al
total 12
drwxr-xr-x 2 grubei1111 psacln 4096 Jan 22 02:05 .
drwxr-x--- 4 grubei1111 psaserv 4096 Jan 22 01:57 ..
-rw-r--r-- 1 root root 61 Jan 22 02:05 .htaccess
[root@web control]# chown grubei1111:psacln .htaccess
[root@web control]# ls -al
total 12
drwxr-xr-x 2 grubei1111 psacln 4096 Jan 22 02:05 .
drwxr-x--- 4 grubei1111 psaserv 4096 Jan 22 01:57 ..
-rw-r--r-- 1 grubei1111 psacln 61 Jan 22 02:05 .htaccess
[root@web control]#

now when you try to surfthe url http://www.yourwebhosters.com/control or http://yourwebhosters.com/control gets a http 404 error.. can't be found.. does this mean i need the index.html there? and if so what do i put in it? etc... i'm sure were really close here ... so far so good..

-Mike



Just for the heck of it... I tried editing the .htaccess file and it originally had
Redirect /control/index.html https://yourwebhosters.com:8443 and changed it to
Redirect /control https://yourwebhosters.com:8443
still got a 404 error... so.. i am lost..

anyone else have any suggestions?

-Mike
 
Hmm, I do not have a index.html, it's really not needed as /control/ should work. Everything you did looks correct not sure what the issue is.

A quick fix would be to create the new file index.php in the directory:
<?php
header("Location: https://domain.com:8443/");
?>
 
?

Originally posted by cYon
Hmm, I do not have a index.html, it's really not needed as /control/ should work. Everything you did looks correct not sure what the issue is.

A quick fix would be to create the new file index.php in the directory:
<?php
header("Location: https://domain.com:8443/");
?>

I'm not sure what exactly your trying to have me do here

-Mike
 
basically instead of using a .htaccess file to forward the user to plesk. Just create a file named index.php in your control folder then add the above code and modify with your domain. Then when you access http://domain.com/control/ it will forward the user onto the contron panel.
 
Re: ?

Originally posted by thundercon787
I'm not sure what exactly your trying to have me do here

-Mike

Ok I made a new file called index.php and inside it i did what you said to do...

<?phpheader("Location:https://yourwebhosters.com:8443/");?>

then saved it and followed to this..

I also chmod the user:group, gave it 777 permissions and tested it out.. still not comming up..

click it http://yourwebhosters.com/control

here is what i did..

[root@web control]# ls -al
total 16
drwxr-xr-x 2 grubei1111 psacln 4096 Jan 22 05:05 .
drwxr-x--- 4 grubei1111 psaserv 4096 Jan 22 01:57 ..
-rw-r--r-- 1 grubei1111 psacln 61 Jan 22 02:18 .htaccess
-rw-r--r-- 1 root root 61 Jan 22 05:05 index.php
[root@web control]# chown grubei1111:psacln index.php
[root@web control]# ls -al
total 16
drwxr-xr-x 2 grubei1111 psacln 4096 Jan 22 05:05 .
drwxr-x--- 4 grubei1111 psaserv 4096 Jan 22 01:57 ..
-rw-r--r-- 1 grubei1111 psacln 61 Jan 22 02:18 .htaccess
-rw-r--r-- 1 grubei1111 psacln 61 Jan 22 05:05 index.php
[root@web control]# chmod +x index.php
[root@web control]# chmod 755 index.php
[root@web control]# ls
index.php
[root@web control]# ls -al
total 16
drwxr-xr-x 2 grubei1111 psacln 4096 Jan 22 05:05 .
drwxr-x--- 4 grubei1111 psaserv 4096 Jan 22 01:57 ..
-rw-r--r-- 1 grubei1111 psacln 61 Jan 22 02:18 .htaccess
-rwxr-xr-x 1 grubei1111 psacln 61 Jan 22 05:05 index.php
[root@web control]# chmod 777 index.php
[root@web control]# ls -al
total 16
drwxr-xr-x 2 grubei1111 psacln 4096 Jan 22 05:05 .
drwxr-x--- 4 grubei1111 psaserv 4096 Jan 22 01:57 ..
-rw-r--r-- 1 grubei1111 psacln 61 Jan 22 02:18 .htaccess
-rwxrwxrwx 1 grubei1111 psacln 61 Jan 22 05:05 index.php
[root@web control]#

would i have to change the redirect that we first innitially did from index.html to index.php and that should work? and if so shouldi used the same command string ro change it out.. i'm confused..

-Mike
 
Originally posted by cYon
Mike,
Delete the .htaccess we do not need it anymore all you need is the index.php file with the code I gave you.

You have the code shown as:
<?phpheader("Location:https://yourwebhosters.com:8443/");?>

The above will generate errors if that's what you used you need:
<?php header("Location: https://yourwebhosters.com:8443/"); ?>

Hey cYon,

Thanx a bunch.. I deleted out the .htaccess and took the redirect away and Put your link in and it worked.. Jsut make sure you give the permissions to the file and make sure its executable.. thanx alot man! It helped out!

-Mike
 
Back
Top