easy mod_rewrite 500 POINTS URGENT

How do I make it so if the start of the url is http://ftp. or https://ftp. it will change it to ftp://www?

Max

This should work for all domain I have so it will just change the http://ftp. part.
LVL 4
TheMaximumWeaselAsked:
Who is Participating?
 
caterham_wwwCommented:
Again in your httpd.conf/virtual host, if you're using virtual hosts

RewriteEngine on
# matches e.g. ftp.example.com, captures example.com in %1
RewriteCond %{HTTP_HOST} ^ftp\.(.+)
# force redirection to ftp://www and the captured value in %1
RewriteRule ^/(.*) ftp://www.%1/$1 [R=301,L]
0
 
TheMaximumWeaselAuthor Commented:
Perfect Answer!

Thanks,
Max
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.