StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Register | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General Discussion
 Off Topic
 Friendly URLs
 New Topic  Reply to Topic
 Printer Friendly
Author  Topic Next Topic  

shroom

2 Posts

Posted - 03/23/2014 :  07:54:46  Show Profile  Reply with Quote
Hi Rob,

I emailed you several times a few years ago concerning S+. I think my old username was 'fug'. I still use S+ regularly on every PC.

I have a completely OT question. I see you're using snitz forums for this site, which is written in classic ASP. How are you getting it to work with SEO friendly URLs? IOW, how/where are you handling the rewrite rules?

Thanks,
Rob

Edited by - shroom on 03/23/2014 07:55:42

Rob

USA
2591 Posts

Posted - 03/23/2014 :  12:45:03  Show Profile  Visit Rob's Homepage  Reply with Quote
Hiya fug!

I just installed the URL Rewrite IIS extension and defined the rewrite rules. Then I did a search through all of the Snitz ASP pages for ".asp" and updated its link generation code points accordingly. Here's the rewrite config section (from web.config) for the site for reference.


        <rewrite>
            <rules>
                <clear />
                <rule name="CanonicalHostNameRule1">
                    <match url="(.*)" />
                    <conditions>
                        <add input="{HTTP_HOST}" pattern="^www\.strokesplus\.com$" negate="true" />
                    </conditions>
                    <action type="Redirect" url="http://www.strokesplus.com/{R:1}" />
                </rule>
                <rule name="LowerCaseRule1" stopProcessing="true">
                    <match url="[A-Z]" ignoreCase="false" />
                    <action type="Redirect" url="{ToLower:{URL}}" />
                </rule>
                <rule name="RemoveTrailingSlashRule1" enabled="false" stopProcessing="true">
                    <match url="(.*)/$" />
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                    </conditions>
                    <action type="Redirect" url="{R:1}" />
                </rule>
                <rule name="Downloads" stopProcessing="true">
                    <match url="^downloads/?$" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Rewrite" url="/forum/forum.asp?FORUM_ID=6" />
                </rule>
                <rule name="Scripts">
                    <match url="^scripts/(\d*)$" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Rewrite" url="/script_detail.asp?scrid={R:1}" />
                </rule>
                <rule name="Script Types">
                    <match url="^scripts/type/(\d*)$" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Rewrite" url="/script_type.asp?sctid={R:1}" />
                </rule>
                <rule name="Windows 8 Notes Post" stopProcessing="true">
                    <match url="^windows8/?$" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="http://www.strokesplus.com/forum/topic.asp?TOPIC_ID=565" />
                </rule>
                <rule name="Custom Config Path" stopProcessing="true">
                    <match url="^customconfig/?$" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/forum/topic.asp?TOPIC_ID=347" />
                </rule>
                <rule name="Topic: Old Pattern" enabled="true" stopProcessing="true">
                    <match url="^forum/topic\.asp$" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{QUERY_STRING}" pattern="^TOPIC_ID=(\d+)+$" />
                    </conditions>
                    <action type="Redirect" url="/forum/topic/{C:1}/" appendQueryString="false" redirectType="Permanent" />
                </rule>
                <rule name="Forum: Topic View" stopProcessing="true">
                    <match url="^forum/topic/(\d+)(/([0-9a-zA-Z\-]+))?/?$" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Rewrite" url="forum/topic.asp?TOPIC_ID={R:1}" />
                </rule>
                <rule name="Forum: Main" stopProcessing="true">
                    <match url="^forum/(\d+)(/([0-9a-zA-Z\-]+))?/?$" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Rewrite" url="forum/forum.asp?FORUM_ID={R:1}" />
                </rule>
                <rule name="Forum: Category" stopProcessing="true">
                    <match url="^forum/cat/(\d+)(/([0-9a-zA-Z\-]+))?/?$" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Rewrite" url="forum/default.asp?CAT_ID={R:1}" />
                </rule>
                <rule name="Forum: Old Pattern" stopProcessing="true">
                    <match url="^forum/forum\.asp$" />
                    <conditions>
                        <add input="{QUERY_STRING}" pattern="^FORUM_ID=(\d+)+$" />
                    </conditions>
                    <action type="Redirect" url="/forum/{C:1}/" appendQueryString="false" />
                </rule>
                <rule name="Category: Old Pattern" stopProcessing="true">
                    <match url="^forum/default\.asp$" />
                    <conditions>
                        <add input="{QUERY_STRING}" pattern="^CAT_ID=(\d+)+$" />
                    </conditions>
                    <action type="Redirect" url="forum/cat/{C:1}" appendQueryString="false" />
                </rule>
            </rules>
            <outboundRules>
                <rule name="Outbound: Remove Trailing Question Mark" enabled="true">
                    <match filterByTags="A" pattern="(.*)\?$" />
                    <action type="Rewrite" value="{R:1}" />
                </rule>
                <rule name="Outbound: Remove Trailing Slash">
                    <match filterByTags="A" pattern="(/forum/topic/(.*))/$" />
                    <action type="Rewrite" value="{R:1}" />
                </rule>
            </outboundRules>
        </rewrite>
Go to Top of Page

shroom

2 Posts

Posted - 03/23/2014 :  13:58:07  Show Profile  Reply with Quote
Hey, man! Thanks! I have URLRewrite installed already. I'll look through what you posted above and figure it out. I didn't realize URLRewrite would work with classic ASP. I really don't know why... I have it working for a couple of PHP sites running on IIS8, so it should work for ASP as well.

Thanks again!

Rob
Go to Top of Page
   Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000