easy mod_rewrite 500 POINTS URGENT

Posted on 2006-03-27
Medium Priority
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

caterham_www earned 2000 total points
ID: 16306626
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]

Author Comment

ID: 16307128
Perfect Answer!


Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
The title says it all. Writing any type of PHP Application or API code that provides high throughput, while under a heavy load, seems to be an arcane art form (Black Magic). This article aims to provide some general guidelines for producing this typ…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month16 days, 1 hour left to enroll

850 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