3

I submitted my site's URL to my workplace's printed newsletter and when I get the printed version, they added a dot to the end of it. Some people will realize that the period is not a part of the URL but others will not. Is there an easy way to redirect from http://example.com/home. to http://example.com/home?

I have a IIS 7.0 shared hosting with GoDaddy. This means I have access to the box only through their interface so some options might be limited.

2
  • As a sidenote, if you had delivered your address as http://example.com. you'd be out of luck. Including a path or just the trailing slash (http://example.com/.) allows all of this to happen. Furthermore, if there was no path, there would be no need to configure anything.
    – Alpha
    Commented Jul 4, 2013 at 22:01
  • This depends on the web server and configuration, which is IIS 7.0 on Windows in this case (periods aren't treated the same way as Linux/Unix). RFC1738 doesn't disallow periods in URL's either, see this for more on that: Can . (period) be part of the path part of an URL?
    – dan
    Commented Jul 10, 2013 at 23:05

2 Answers 2

1

GoDaddy's Windows shared hosting accounts with IIS 7.0 support the Microsoft URL Rewrite Module, which provides URL redirect functionality similar to Apache's mod_rewrite module, that the previous answer references.

To use this module, you would either modify or create a web.config file, located in your root directory and then restart the IIS service.

I'm unable to test this, but that might look something like:

<?xml version="1.0"?>
<!-- Web.Config Configuration File -->
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect dot to domain " stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^example.com/home.$" />
</conditions>
<action type="Redirect" url="http://example.com/home/{R:0}”
redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

The lines to modify for your domain (and possibly the patterns too) are:

<add input="{HTTP_HOST}" pattern="^example.com/home.$" />

<action type="Redirect" url="http://example.com/home/{R:0}”

For more on pattern matching, see: URL Rewrite Module Configuration Reference: Rule Pattern

Lastly, if this proves difficult for you and you're not dependent on using Windows for your web hosting account, you can simply switch to Linux web hosting with GoDaddy instead - see this for more: GoDaddy Support: Switching Your Hosting Account Operating System

0
0

Add this to your .htaccess:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.comt$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteRule ^home\.$ "http\:\/\/example\/home" [R=301,L]
2
  • That's assuming they are using Apache. If they are on windows I would assume IIS.
    – John Conde
    Commented Jul 2, 2013 at 21:02
  • It is IIS 7.0, with shared hosting you don't have access to the full machine unfortunately so that might also limit what I can do
    – Michael
    Commented Jul 2, 2013 at 21:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.