II6 ISAPI SEO rewrite rule re html extensions

ISAPI_Rewrite is a powerful URL manipulation engine based on regular expressions
User avatar
Posts: 6
Joined: 09 Aug 2014, 07:40

II6 ISAPI SEO rewrite rule re html extensions

09 Aug 2014, 07:59

Hi,
Am a newcomer to II6 and would be grateful for help on this.

Within the httpd.ini file I can do a RewriteRule to give a SEO freindly url in place of a single html file thus;
RewriteRule /dir/article-test-one?$ /dir/article-test-one.html [L]

RewriteRule ^/article-test-one\.html DOMAIN/article-test-one [I,O,RP,L]

What I would like to do however is to apply a general rule so that ALL the HTML files within the directory "dir" are rewritten to lose their HTML extensions and have a general 301 redirect to say the same.

Is this possible within IIS6 ?
thanks
Neil

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: II6 ISAPI SEO rewrite rule re html extensions

11 Aug 2014, 13:44

Hello, Neil

The rule should be like this:

RewriteRule /dir/(.*)\.html /dir/$1 [I,RP,L]
RewriteRule /dir/([^./]+)$ /dir/$1.html [I,L]

User avatar
Posts: 6
Joined: 09 Aug 2014, 07:40

Re: II6 ISAPI SEO rewrite rule re html extensions

11 Aug 2014, 17:28

Hello Anton,
That is fantastic , works an absolute treat :-)

Many thanks
Neil

User avatar
Posts: 1
Joined: 22 Aug 2017, 03:32

Re: II6 ISAPI SEO rewrite rule re html extensions

22 Aug 2017, 03:48

Perhaps for consistency yet the "looking motor issue" can be effectively settled making a revise decide that change each .html ask for into a .php one, with the goal Dissertation Writing Service | www.dissertationhub.co.uk that listed pages will be as yet reachable

Return to ISAPI_Rewrite 2.x

Who is online

Users browsing this forum: No registered users and 2 guests