Question: I've found a couple similar questions asked before, but none with a concrete solution it seems. What I'm after is as follows; in the rare cases where a visitor forgets to add the .html extension to the end of a url (typing everything else in the string properly however), I'd like them to be directed to the page they were aiming for, *with* the .html extension.

Possible?

Current .htaccess code:

```
ErrorDocument 404 /404.html

#Canonical
RewriteCond %{HTTP_HOST} ^domain\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.domain\.com$
RewriteRule ^index\.html$ "http\:\/\/www\.domain\.com\/" [R=301,L]

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

#Blocking
<IfModule mod_setenvif.c>
    Order Allow,Deny
    Allow from all
    Deny from 123.151.39.
    Deny from 186.219.44.6
</IfModule>
<IfModule mod_rewrite.c>
    RewriteCond %{HTTP_HOST} (.*)\.crimea\.com [NC,OR]
    RewriteCond %{HTTP_HOST} s368\.loopia\.se [NC,OR]
    RewriteCond %{HTTP_HOST} kanagawa\.ocn [NC,OR]
    RewriteCond %{HTTP_USER_AGENT} (huaweisymantecspider|sitesnagger|spam|sucker|webcopier|webreaper|webstripper) [NC]
    RewriteRule .* - [F,L]
</IfModule>

```

Answer: 
There are func's that are called automatically when the map is in use. One of them is 

func mapViewDidFinishLoadingMap(mapView: MKMapView)

Try doing this.

```
  func mapViewDidFinishLoadingMap(mapView: MKMapView) {
    map.setRegion(mapRegion, animated: true)
}

```

If this doesn't work type func mapView and look in the list and find one you think might but I feel this is where it needs to be.
In ViewController.swift, find viewDidLoad and add the following to the end of the method:

```
// set initial location in Honolulu
let initialLocation = CLLocation(latitude: 21.282778, longitude: -157.829444)

```

You’ll use this to set the the starting coordinates of the map view to a point in Honolulu.
When you are trying to tell the map what to display, you can’t just give a latitude and longitude. That’s enough to center the map, but you need to specify the rectangular region to display to get a correct zoom level too.
Add the following constant and helper method to the class:

```
let regionRadius: CLLocationDistance = 1000
func centerMapOnLocation(location: CLLocation) {
  let coordinateRegion = MKCoordinateRegionMakeWithDistance(location.coordinate, 
    regionRadius * 2.0, regionRadius * 2.0)
  mapView.setRegion(coordinateRegion, animated: true)
}

```

The location argument is the center point. The region will be have north-south and east-west spans based on a distance of regionRadius – you set this to 1000 meters (1 kilometer), which is a little more than half a mile. You then use regionRadius \* 2.0 here, because that works well for plotting the public artwork data in the JSON file.
setRegion tells mapView to display the region. The map view automatically transitions the current view to the desired region with a neat zoom animation, with no extra code required!
Back in `viewDidLoad`, add the following line to the end of the method:

```
centerMapOnLocation(initialLocation)

```

This will call the helper method to zoom into `initialLocation` on startup.
Build and run the app, and now it should zoom in to the heart of Waikiki :]

Font: <http://www.raywenderlich.com/90971/introduction-mapkit-swift-tutorial>