IIS 7.5 URL Rewrite Different Domains pointed to a single site - url-rewriting

I have a single site at www.domain1.com. It's a PHP site being hosted on a Windows 2008/IIS 7.5 box. I need to set up www.domain2.com so that users are redirected to www.domain1.com/subfolder. To the user, they still see www.domain2.com in the address bar but are looking at the www.domain1.com/subfolder.
Any help on how to achieve this would be greatly appreciated!

You need to use IIS Application Request Routing and Url Rewrite modules. This walkthrough describes almost exactly what you are trying to achieve.

Related

Angular UI-Router (1.x) Change Host Url

I have a requirement from a client to change the web site Url to a subdomain when they enter the checkout section of the site we are developing for them. For example from www.mysite.com to checkout.mysite.com. We are using UI-Router in HTML5 mode and would like to have the router change the Url to the subdomain instead of going to www.mysite.com/checkout. Does anyone know a way that this can be accomplished? I've also tried using pushState but without success. All of the subdomain suggestions I've tried have not worked. Honestly even if I just put a "fake" url that would work fine too. Changing the Url is more of a visual thing instead of actually redirecting to a subdomain.
After much review I found that this cannot be done because it is a security issue; even switching to a subdomain (which is what I was trying to do) is not allowed.

Wordpress Issues Regarding IP and Domain Name - Host Gator

I am hoping somebody can help me because I am on the verge of frustration tears.
The company I work for has a site hosted on godaddy and has to remain up until I complete the rebuild on hostgator, using the Wordpress theme, Grand Restaurant http://themes.themegoods2.com/?theme=GrandRestaurant
To get around the domain name issue since I cannot change nameservers yet, I had to use the Google Chrome plugin, Virtual Hosts, which has me input the IP and domain, to force access to the site.
Everything was working fine until I needed to use the "content builder." If you look at the Grand Restaurant theme, you can click on Menu. I need to use the "Menu Grid" option in the content builder but it does not work. Whenever I try to add the menu grid, it appears that it is trying to load (showing the gif loading image) yet in never actually loads. I have spent several days and hours going back and forth with host gator and the theme developer.
The theme developer says that the content builder does not work because:
"The WordPress URL and Site URL are set to the domain name. When you are logged in, you are being redirected to the IP, so the browser sees 2 different sites and some functionality ex. AJAX call doesn't allow you to get data from different URLs.
Your WordPress URL and Site URL settings are different from your actual site. You have to change your Domain Name URL and Site URL settings to the IP number."
I did what he said earlier today and it completely broke the site. Spent nearly 2 hours with host gator's tech support to get it back up. All tech support will tell me in regards to the content builder not working is that I need to change the AJAX file to allow the site URL and wordpress URL to be different. I have no idea how to do that!
Any wisdom you all could provide would be greatly appreciated. I have 1700 bakery items that I need upload by the end of July and I do not know what I am going to do if I cannot get the content builder working.
In order for this to work properly you should be using a method of back up and restore. By migrating from one hosting provider to another you could simply deploy the new Wordpress on host gator as a new site and import the Wordpress backup to the host gator with the many different plugins available through Wordpress. The way your trying to complete this is impossible and usually will only work with images and back ups being managed on virtual machines, and VPS. It won't hurt anything on the original up and running site. You mentioned that host gator was able to get the site back up? You shouldn't have to rebuild this if you use a back up and restore method. Everything should fall right into place, you can also test these methods through virtual box, and VMware virtualization products which offer trial versions. Try using a migration method and see if the conflicts still persist with the content builder.
Heres is what I would do if you cannot change the domain over but still use the domain for the dev environment.
Modify your hosts file and use hostgators IP and the company domain as the entry.
Install wordpress to the current company domain by simply entering the domain (Should go to hostgators server since you've added that entry in your hosts file)
With the hosts file modification, you should be able to view the wordpress site thats hosted with hostgator using the live domain name.
This way, when you're launching, theres no need to do any modification on wordpress. Simply change the DNS over, revert your hosts file and the site will swap over seamlessly.

Routing a url to fetch content from another site

Environment: IIS 7.
I have a default site www.domain.com. Folder C:Inetpub/wwwroot/domain
There is subdomain www.subdomain.domain.com. Folder C:Inetpub/wwwroot/domain/subdomain.
Now, I have set up a new website at an external server, say www.newdomain.com. I cannot host www.newdomain.com on the same IIS server (as mentioned above) due to some constraints.
In this setup, how do I get www.subdomain.domain.com/blog to show all the content available on www.newdomain.com while preserving the URL as www.subdomain.domain.com/blog
How could this be achieved in IIS 7?
You would have to put the entire www.subdomain.domain.com on the other server. You can't put just the /blog path somewhere else.
How would any client know to go to that other server for /blog if the DNS for the subdomain points to the first server?
Alternatively, you could create blog.subdomain.domain.com for the blog server.
Possible approaches:
Host the new website as blog.domain.com with the actual content hosted on a different server (not the same IIS server as domain.com)
Set-up a ProxyPass on subdomain.domain.com/blog to the new website. I know how do to this on Apache (via mod_proxy and ProxyPass), but not sure how to do this with IIS. Probably ARR can help you.
I was finally able to do this by reverse proxy rewrite rule. For those who have similar trouble here is the solution:
Go to the site node hosting www.subdomain.domain.com and click rewrite rule. If ARR is not installed the IIS Manager will ask you to install it. After installing ARR close and reopen the IIS Manager.
Open the rewrite rule window. There will be a dialog asking to allow reverse proxy to servers outside your server farm, accept that. In the Inbound rule enter www.newdomain.com. In the from input of the Outbound rule enter www.newdomain.com and in the to input enter www.subdomain.domain.com. click apply changes.
This will route the entire www.subdomain.domain.com to newdomain.com. What you need is to route only the /blog link.
To do this go to rewrite rules and select the rewrite rule you just created. Click edit and in the match section in url input change (.asterix) to ^blog(.asterix). This will apply the rule to route only the /blog.
That all. test your routing in the browser, if everythings fine this should work.

Hot to block access to page with defined URL in ASP.NET site on IIS except from one defined IP?

We have ASP.NET web site hosted on IIS.
We need to block access to page "http://www.example.com/sample/page1.aspx" from any IP.
We want to define single IP which can access this page.
What option of IIS or Windows can help me?
If you are using IIS7 + you could use the URL Rewrite Module http://www.iis.net/download/urlrewrite
However if you are using IIS6 you can try a tool like Helicon ISAPI Rewrite http://www.helicontech.com/isapi_rewrite/ which will allow you to write an IP based rule.
Try this in your code behind (although this is not IIS or Windows as you request):
if (Request.UserHostAddress == "1.1.1.1") { }
Obviously substitute the IP address you want!

404 error after hosting website developed using codeigniter

I am trying to develop an web application that takes google address and stores for future use..
I am a little new to codeIgniter and a little help would be appreciable...
I have developed the application in WAMP 2.0..
It works fine there..But when I upload it to a production server, it displays the index page..but as soon as I try to navigate to other pages from the home page it gives a
404 Page Not Found..
You can always check the site here..
The entire application is working fine in my localhost that is in WAMP..
Thanks in advance
it may be to do with case sensitivity in *nix and windows environments.
this link works:
http://www.poimart.com/index.php/poi/create_user
but this doesn't (404s) (no capital P)
http://www.poimart.com/index.php/Poi/create_user
so any references to your pages within your app should have lower case.
Have you checked if any .htaccess file exists in your document root?

Resources