easy mod_rewrite 500 POINTS URGENT

Posted on 2006-03-27
Last Modified: 2010-03-04
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?


This should work for all domain I have so it will just change the http://ftp. part.
Question by:TheMaximumWeasel
    LVL 27

    Accepted Solution

    Again in your httpd.conf/virtual host, if you're using virtual hosts

    RewriteEngine on
    # matches e.g., captures 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]
    LVL 4

    Author Comment

    Perfect Answer!


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting ( to http…
    Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
    This video discusses moving either the default database or any database to a new volume.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now