URL rewriting in IIS for a php/linux guy - iis

I'm a PHP/linux guy....
One of my customers came to me with an existing website/hosting package....
The hosting is windows (but with PHP.....I don't know, it just is)
I need to learn how to rewrite URLs in IIS..
I understand you usually do it with a separate thing you install, called url rewrite module?....Or, is there an equivalent of the .htaccess file which i can place in the root folder?
If yes, is this something that I should expect the hosting company to already have installed?
Is it done in PERL regex in IIS?
Please HELP.
I can't change the hosting comapny or any variables (windows/linux) in the current hosting as my customer cannot have a second where the site is down...so i need to know how to rewrite urls in windows/IIS
I am willing to learn little things like this anyways, for future situations...
It's IIS 7...windows 2008 and PHP...
I don't know if it's against rules to mention names of companies...please don't grill me if it is, just giving as much info as possible and maybe someone will have the same experience as me....
its fasthost..
Thanks

If you have access to the server / IIS then you can install http://www.iis.net/downloads/microsoft/url-rewrite
This will add a module where you can configure rewrites and redirects.
If you dont have access to the server / IIS and this module is installed then each web root will have a web.config file which contain the rules and other IIS configurations. You will have to contact the hosting company to see if the module is installed. It usually is.
This page gives an overview of both:
http://www.iis.net/learn/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module

Related

Switch ColdFusion 11 from built in web server to IIS

I originally installed ColdFusion 11 in a local environment (windows 7) and selected "Use built in web server". Everything was working pretty good. Now months later, I realize I need to use a real web server for URL rewrites (Apache, IIS, etc) but there is no documentation I can find on how to do so.
I have attempted looking through the administrator's panel for any information, but couldn't even get a jumping off point. Any assistance would be greatly appreciated.
First, it sounds like you need to decide which web server you want/need to use and that could be determined by where you'll end up hosting your site. CF code is quite portable but if you're doing URL rewrites, file system access, etc... then you need to code those to match the production environment, otherwise you might find yourself having to rewrite and retest all that again.
As commented above, a lot of information about configuring CF for web servers is available by searching. You'll first need to install & configure your web server, so search around that first. Then you'll need to configure the web server to understand which requests to pass to ColdFusion's engine.
If it's IIS then you need to make sure IIS is installed and the following components are installed: ISAPI Extensions, ISAPI Filters, CGI, ASP .NET
Then configure an IIS site to point to your CF code and after that use the "Web Server Configuration Tool" application (installed with CF) that will associate the relevant file types with ColdFusion.
Most of the time it's as simple as that.

IIS 10.0 - using mod_rewrite rules

I develop websites on my local machine (windows 10 with IIS 10.0) and then upload them to a linux server where it uses the .htaccess files (mod_rewrite format) for url rewriting.
Is there any way possible to use this mod_rewrite format on my local machine (iis 10)? Every attempt I have made so far has failed to work.
This post mentions that an update version of ionic's isapi rewrite is available, but even this updated file does not appear to work for IIS10.
Also: I am aware that you can import rewrite rules through IIS Manager -> Url Rewrite -> (Actions) Import Rules. This however has not been ideal for my situation.
Would the best course of action for me, to be to run something like this apache server on my windows 10 machine and have websites setup through there for testing (which may then support the .htaccess files)?
Any advice, solutions, knowledge, feedback is appreciated! Thank you.

.htaccess file location for OpenStack with Go

I'm using OpenShift, and I'd like to know where the .htaccess file should go with Go language (golang). I tried all locations with other languages, none of them worked.
Edit:
Yes, I created a 1 small gear application with Go language cartridge. Everything default, so it's The Go Cartridge
I guess you are using the Go cartridge; as far as I know it the .htaccess file should be on the web server gear. Your web server should run on the primary gear but without any other info it's hard to provide a meaningful answer.

Multiple sitecore instances hosted on one domain

I want to install multiple Sitecore instances to be hosted under one domain. So the root url of first instance will be http://example.com/instance-1 and so on.
The reason I want to have multiple instances is that, I want to split environments for each site. I know I can play with bindings and publish each instance on other port within same domain. I also know that I can install multiple sites under one instance. But I didn't found solution how to install instance in IIS site subdirectory.
Please if anyone was successful instaling multiple instances as child application or virtual directory, please share the knowledge.
I'm using Sitecore 6.5 and IIS 7.5
Sitecore does not support running in virtual directories.
It must run in its own website.
However, i did come up with a trick, but it is quite advanced and i don't have clear cut examples:
Setup one site that will be your main domain with sub folders (eg.
www.mydomain.com/site-a , www.mydomain.com/site-b
Setup your separate Sitecore instances as separate IIS websites
Give each site its own hostname and add it to your hosts file (so you get http://site-a, http://site-b, etc)
Install the IIS URL Rewrite feature, make sure rewriting of the HTTP_HOST server variable is allowed
Configure rewriting on your main site, so that http://www.mydomain.com/site-a/* is rewritten to http://site-a/*
Create a custom linkprovider that makes sure Sitecore links are being written using the correct domain and folder (so http://site-a/item is written as http://www.mydomain.com/site-a/item)
I'm sure this is possible as i've implemented a similar solution for a site that hosted clones if a site as 'virtual' folders.
I wonder why you have the need to host multiple Sitecore instances on the same domain. Sitecore has good solutions for multi site setup in the same instance. If the solution Ruud provided is not workable for your, check the multi site solution of Tim Ward ( https://github.com/jerrong/Sitecore-Multisite-Manager ) or the shared source module on the Sitecore Marketplace ( http://marketplace.sitecore.net/en/Modules/Multiple_Sites_Manager.aspx )

URL Rewrite Deploy to Production Server

I've finished url dynamic rewrite module on my local computer, iis, everything is working but I have to deploy it to the production server now, which will cause errors. Do you have any idea how to avoid them?
If you have done similar thing before...
Thanks in advance
You could create a copy of the production server in a virtual machine and try to deploy your rewrite rules there.
VirtualBox is a simple engine to create a VM.
I do mine within a test vm environment then make my edits to the Production Site off hours to avoid the IIS Restart when saving rules.
If you want to move them up in one piece I have thought of making the edits to the machine.config file but after some discussions with our IT group found that was not a workable solution. Editing the rules on the Web Servers then testing them after being added is the course I have followed so far.

Resources