Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
328 views
in Technique[技术] by (71.8m points)

.htaccess - How to reditect sub.domain.com to sub.domain.com:8069/web/login

Want to redirect my subdomain from :

sub.example.com

to

sub.example.com:8069/web/login

in my webhosting admin it does not let me redirect to specific port (says invalid input)

What is the easiest way to do this?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Ensure that mod_rewrite is enabled.

RewriteEngine on
RewriteBase /
RewriteCond %{SERVER_PORT} 80 [NC,OR]
RewriteCond %{SERVER_PORT} 443 [NC]
RewriteRule ^(.*)$ http://sub.example.com:8069/web/login [R=301]

It will redirect everything from sub.domain.com on :80 and :443 to :8069 and /web/login


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...