?
Solved

Windows Server Equivalent to Unix Server .htaccess (RewriteEngine, RewriteCond, ReWriteRule)

Posted on 2005-03-27
15
Medium Priority
?
1,838 Views
Last Modified: 2012-06-27
Hi,

I'm in need of a windows server equivalent to three unix functions ...

The Situation:
I have a windows 2003 server with a dynamic .NET website that displays about 1.200 different working platforms (boom lifts) in 10 different languages -> meaning, there are not 12.000 static HTML files ... no, there's just 1 ASPX file that displays all 1.200 working platforms multiplied by ten languages (12.000 files) dynamicly (database-driven) depending on certain parameters ...

... now, for different reasons (SEO etc.)  I'm changing the entire site structure ... returning to static HTML files ...

... since all working platforms are already in the main search engines (Google, Yahoo, MSN etc. in all languages!) it would be a break to just generate the new site structure and send all already established links to that site to a "site not found" error ...

... what I'm using on my unix servers in those kind of cases are three simple .htacces functions ... in the current case this would look like:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^.*\.w62.net/.*$ [NC]
ReWriteRule .*\*.aspx$ http://www.w62.net [R,L]

... these three functions would do all I need -> but only on my unix servers!

What I need is an equivalent to the described functions on a Windows 2003 Server (IIS 6.0) ...

I know that on a Windows 2003 Server there's (basicly) no equivalent to the .htaccess options that unix servers are offering ... I've read http://support.microsoft.com/default.aspx?scid=kb;en-us;324064 ... http://www.webhostingchat.com/forum/archive/index.php/t-624 ... http://www.christian-web-masters.com/articles/web_servers__page_1.html ... and many more articles -> all telling me that there's no way of doing what I want to do ...

... it's just -> that I can't believe that I pay five times more for a Windows Server than for a Unix Server and that I'm supposed to accept that -> I have less functionality on Windows Server than on a Unix Server ... ;-))


Best regards,
Raisor


0
Comment
Question by:Ralf Klatt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
  • 2
  • +1
15 Comments
 
LVL 33

Expert Comment

by:humeniuk
ID: 13640222
You are correct that Windows/IIS has nothing quite the same as the mod_rewrite module you refer to above.  However, there is a third-party ISAPI filter that will do the trick for you.  It's called ISAPIrewrite and you can find it here: www.isapirewrite.com.  The bad news - and given your post, I doubt this will come as much of a surprise :) - is that it isn't free, it costs $69.  You can find a cheaper version ($39) here: www.iismods.com/url-rewrite/index.htm, but I've never used it, so I can't really comment on its quality or effectiveness.

Since you would be using this largely for SEO purposes, I would recommend that you read the 'tips' section of the website that refers to 301/permanent redirects - www.seoconsultants.com/windows/isapi/tips.  Remember that a 301 redirect is the only one that will pass on the PR and other SE benefits of the old page to the new page.  As an aside, if you were using mod_rewrite as you mentioned above, your proper syntax for a permanent redirect should be:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^.*\.w62.net/.*$ [NC]
ReWriteRule .*\*.aspx$ http://www.w62.net [R=301,L]
0
 
LVL 96

Expert Comment

by:Lee W, MVP
ID: 13640418
Two other suggestions:

1. Use Apache instead of IIS - If your serving static HTML pages, this should work fine for you.
2. Use NTFS security and enable Basic Authentication, disable Anonymous access.
0
 
LVL 15

Author Comment

by:Ralf Klatt
ID: 13642188
Hi,

Thanks for both answers!

@leew ... I won't install Apache on my Windows Servers -> I have tested/evaluated this a couple of years ago on one system and Apache was the cause for huge memory leaks on that system ... Anonymous access is nessecary ...

@humeniuk ... I won't pay for a DLL that does just one trick! ... I'll read the article at www.seoconsultants.com/windows/isapi/tips you've provided ... if that doesn't push me to the right direction then I'll see if I can write an ISAPI.DLL on my own -> do you have any sources to programming ISAPI (before I open an additional question in the programming area)? ... as for rewrite syntax -> [R,L] always worked for me! -> what's the impact on using [R=301,L]?


Best regards,
Raisor
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 96

Assisted Solution

by:Lee W, MVP
Lee W, MVP earned 400 total points
ID: 13642421
You are aware that they do UPDATE apache, right?

If anonymous access is necessary, adjust file permissions on a per file basis.  or arrange the files in an appropriate manner and put security on some of the sub folders.
0
 
LVL 15

Author Comment

by:Ralf Klatt
ID: 13642576
Hi,

We're talking about aproximately 25.000 static HTML files -> if I'd manage to ajust 100 files per day on a per file basis it would take 250 days until it's done -> not to mention that about 50 working platforms are changing per month (sold ones have to be taken off -> new ones have to be entered) ...

What I'm currently thinking about is to add a Java function to each aspx file that redirects to a propper html-listing ... and wait for 2 to 4 weeks until all search engines have listed the html files ...


Best regards,
Raisor
0
 
LVL 33

Accepted Solution

by:
humeniuk earned 1400 total points
ID: 13643443
"if that doesn't push me to the right direction then I'll see if I can write an ISAPI.DLL on my own -> do you have any sources to programming ISAPI (before I open an additional question in the programming area)?"

Sorry to say that I don't, but I'd certainly be interested in hearing how it goes.


"as for rewrite syntax -> [R,L] always worked for me! -> what's the impact on using [R=301,L]?"

A 301 or permanent redirect is the only on that will pass PR from the old page to the new page.  For example, if www.domain.com/oldpage.html is redirected with a 301 to www.domain.com/newpage.html, Google will assume that the links are for www.domain.com/newpage.html and index it accordingly.  This is the only type of redirect that will do this and it makes sense if you read the RFC 2626 quote on this:

"301 Moved Permanently
The requested resource has been assigned a new permanent URI and any future references to this resource SHOULD use one of the returned URIs.

302 Found
The requested resource resides temporarily under a different URI. Since the redirection might be altered on occasion, the client SHOULD continue to use the Request-URI for future requests."

From an SEO perspective, the objective is to make sure that the server returns an http header with -
HTTP/1.1 301 Moved Permanently
The slight change in syntax ensures that it does.

If a 302 (for example) is returned, then the page is found and the old page will be indexed.  From what I understand, Google will eventually realized that a long-term 302 is meant to be a 301 and will treat it accordingly.  It's not something you want to rely on, though.
0
 
LVL 37

Assisted Solution

by:meverest
meverest earned 200 total points
ID: 13643755
just a few quick comment about isapi - if you have ms visual studio, there are a couple of isapi samples in there that are useful.  the msdn documentation is also very good.  and there are two kinds of isapi, it;s the isapi 'filter' that you want for this job.

cheers.
0
 
LVL 15

Author Comment

by:Ralf Klatt
ID: 13645199
Hi,

@humeniuk ... up today I thought that I'm one of the "few" guys understanding Google ... well, today I've learned something -> but, please give me the time to check if things are like they seem (on a "today's basis") ...

@meverest ... I have all v-studios up to the recent ones ... I've past half of this easter monday to get on the right ISAPI-Track ... well yet, I wasn't successful ...


Best regards,
Raisor
0
 
LVL 15

Author Comment

by:Ralf Klatt
ID: 13646854
Hi,

Well, I've found out a way that will serve to what I'm up to do ... humeniuk has given me some inspiration on why it could be useful to develop my own ISAPI Libraries ... leew is some kind of a practical advisor ... I'll surely continue with Apatche (I'm receiving all UPDATES in an automated way!) ... meverest pointed to the right direction -> msdn -> I've played a little with cgi2asp.exe which I downloaded in source code from msdn and which I'm going to re-engineer the way I need!

Actually, not having the time for any re-engineering projects, what I'll do is the following -> I'll continue developing w62 -> I've already added ten more countries -> all together arround 25.000 static html pages now ... the current ASPX pages will be changed on "Code-Behind-Level" -> I'll be redirecting depending on incoming parameters ... while I can't imagine what impact this might have on SE level (PR etc.) I'm expecting that these changes may give me a 1-3 month headache -> after this period everything will be even better than before ... ;-))

Thanks for all suggestions that helped me making a descision on that matter!


Best regards,
Raisor
0
 
LVL 33

Expert Comment

by:humeniuk
ID: 13647443
First of all, thank you for the A  :)


"@humeniuk ... up today I thought that I'm one of the "few" guys understanding Google ... well, today I've learned something -> but, please give me the time to check if things are like they seem (on a "today's basis") ..."

I'm not sure that anyone really understands Google :)  This is by design, of course.  If one could understand Google, presumably one would be able to exploit their complex (and ever changing) algorithms and achieve higher rankings.  The numerous PhD's on their staff are well paid to keep us in the dark as well as to keep improving the search engine itself.

BTW - if you have any SEO related questions in the future, you should take a look at the Online Marketing TA (www.experts-exchange.com/Web/Online_Marketing).  You'll be sure to get some first-rate advice.

And good luck with the project.  It will be a lot of work, but as you said, worthwhile in the end.
0
 
LVL 15

Author Comment

by:Ralf Klatt
ID: 13647663
Hi,

Thanks fo your latest comment humeniuk!

There might be some kind of obvious arrogance within stating "up today I thought that I'm one of the "few" guys understanding Google ..." ... well, let me tell you that, in the past three years, I've spent most of my time reading and learning about SEO Strategies ... if I'd write an e-book ... ;-)) ... but finally I made it yet to place any kind of (good content!) page at a good position even at google ... not unlike to others I'm also in the dark why a page that worked out for two or three month suddenly gets lost at google ... the only thing that I can assume is, that there are open doors and that there's a way of accusing site owners that they're "spamming" one or another way -> any site owner (small business) that's once have been accused (no matter if right or wrong!) at google can throw his/her page into the bin ... that's my experience ...

... the good is that there's not only google but also other search engines ...

... thanks for the hint to www.experts-exchange.com/Web/Online_Marketing ... I'll certainly have a close look at it!


Best regards,
Raisor
0
 
LVL 33

Expert Comment

by:humeniuk
ID: 13647818
"There might be some kind of obvious arrogance . . . "

I didn't perceive it that way :)


"not unlike to others I'm also in the dark why a page that worked out for two or three month suddenly gets lost at google ... "

SEO is not rocket science, but there are some specific do's and don'ts.  Sometimes there are completely legitimate reasons for a site dropping in the rankings - ie. breaking SEO 'rules', spamming, etc. - sometimes they're not so fair or legitimate - do a search on 'Google Florida update', named after the 2000 Florida election fiasco.  Then there's the dreaded Google sandbox . . .


"the only thing that I can assume is, that there are open doors and that there's a way of accusing site owners that they're "spamming" one or another way -> any site owner (small business) that's once have been accused (no matter if right or wrong!) at google can throw his/her page into the bin ... that's my experience ..."

In most cases, a website or domain can be rehabilitated simply by removing the offending elements.  Once the site is re-indexed, the changes will be taken into consideration.  In the most serious cases of wanton abuse, contacting Google with a serious mea culpa and a demonstration that you've changed your ways or even changing domains will be necessary.


"... the good is that there's not only google but also other search engines ..."

Yes, but the only relevant ones are Google, MSN, and Yahoo!.  Together they will account for 95%+ of your search engine traffic.  Getting your website listed in the appropriate category of the Open Directory Project (www.dmoz.org) is probably next on the list of relevance rather than any other search engine (or perhaps the rest of them combined).


Regards.
0
 
LVL 15

Author Comment

by:Ralf Klatt
ID: 13647972
Hi,

Thanks a lot for your response ... I really appreciate!

To tell you, I'm a Google Media Partner and being that one should not expect that one could be accused from today to tomorrow ... and one would expect that one would be informed that one has been accused so that one could take appropriate measures -> to tell you ... one is just being reduced from 100% to arround 5% -> you may imagine the impact on cash flow and the worst -> the lost of trust from all kind of clients ...

I'm running 50 domains and arround 150 subdomains -> there's always one performing well, two month later another one ... I'm still waiting that they all perform well at the same time! ... ;-))


Best regards,
Raisor
0
 
LVL 33

Expert Comment

by:humeniuk
ID: 13648169
You may be waiting a while for 200/200   :)
0
 
LVL 15

Author Comment

by:Ralf Klatt
ID: 13648241
:)
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question