Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
berzerkmonkey
Jul 23, 2003
We recently moved our ASP website to a new host, and are using Plesk for the control panel. We've got a few domains hosted elsewhere that are supposed to point to sub directories within the main site:

www.shortURL.com
-resolves to-
www.reallylongdomain.com/with/sub/directory/index.asp

This works fine - the domains are pointed to the new host and are forwarded to the proper sub directories.

What isn't working is:

www.shortURL.com/about.asp
-resolves to-
www.reallylongdomain.com/with/sub/directory/index.asp
-instead of-
www.reallylongdomain.com/with/sub/directory/about.asp

Essentially, I want a redirect that retains the unique URL info someone might enter. I don't want them getting redirected to the main directory and have to search for the page.

I see you can do this in IIS, but I don't have access (shared hosting.) I also tried this in the web.config with the following code, but the whole site errors out:
code:
<rewrite>
<rule name="Canonical Host Name" stopProcessing="true">
  <match url="(.*)" />
  <conditions>
    <add input="{HTTP_HOST}" pattern="^www\.shortURL\.com$" />
  </conditions>
  <action type="Redirect" url="http://www.reallylongdomain.com/with/sub/directory/{R:1}" redirectType="Permanent" />
</rule>
</rewrite>
Anyone have any ideas on this one?

berzerkmonkey fucked around with this message at 21:02 on Apr 28, 2016

Adbot
ADBOT LOVES YOU

berzerkmonkey
Jul 23, 2003
Figured it out - I was missing a tag:
code:
<rewrite>
<rules>
<rule name="Canonical Host Name" stopProcessing="true">
  <match url="(.*)" />
  <conditions>
    <add input="{HTTP_HOST}" pattern="shorturl\.com$" />
  </conditions>
  <action type="Redirect" url="http://www.reallylongdomain.com/with/sub/directory/{R:1}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>

  • Locked thread