Wordpress on subfolder of asp.net website - asp.net

I want my website domain subfolder to point to my website on wordpress.com, and keep the website address in the url bar the same.
For instance, the website is www.domain.com, the blog is www.domain.com/blog, and my wordpress site is mysite.wordpress.com. I want www.domain.com/blog to point to mysite.wordpress.com, but not change the url in the url bar.
The website is built on asp.net. Is this possible?

Uhhhhhh, generally, no.
10 years ago, when frames were acceptable you'd have a <frameset> page on your website and you'd load your wordpress blog into a frame and your visitors wouldn't see the wordpress.com domain name in the address bar - but frames are terrible and break things like bookmarking and site navigation, which is why they were removed from XHTML and HTML5 (their replacement, XFrames, is DoA).
Setting up a simple redirection in IIS would sort-of work, but wouldn't preserve your domain name in the address bar because your visitors need to connect to Wordpress directly.
The only solution, therefore, is to set up a proxy service on your website that proxies requests to your website over to Wordpress. This is no easy undertaking, but it is doable. You only need to proxy the HTML (things like images and other assets can be linked fine). You'd do this with a IHttpHandler in IIS that forges a new request to Wordpress and then uses a library like HtmlAgilityPack to replace appropriate URIs in the HTML with those to your proxy service.
Things like POSTable forms and Ajax requests might break - personally I don't think it's worth the hassle. I'd pay for a premium Wordpress.com subdomain, or have a local Wordpress installation.

Related

Website is showing another website on non-existent website page

This is a peculiar one.
I work for an agency, and we develop WordPress and JAM Stack sites for our clients.
I have been contacted by the IT team for one of the clients (an NGO), and they flagged something that I have not seen before.
NOTE: I am going to be using example.org as the website, to protect the identity of the client.
Basically, we developed a WordPress site for them, which works great and all, but as it turn outs there is a page on the website which points to a totally different website
The example page is as follows
example.org/news/points-to-different-website/
The news page doesn't exist in anywhere on WordPress system, and neither does it exist as a custom post type.
And another thing, I noticed is when I removed the / at the end of the URL, it shows the custom 404 page developed for the website
example.org/news/points-to-different-website
But as soon as you add the /, it shows a totally different website.
I have checked all the Apache configuration files related to the site, and it is just the normal setup for any WordPress site.
So, I am wondering what could be causing this, and how can one prevent it?
That's a strange issue. Does example.org/news/points-to-different-website/ actually redirect to another full URL, i.e. differentwebsite.com, or is the different site actually at example.org/news/points-to-different-website/?
Try
emptying the trash for both pages and posts, as there could be a conflicting slug that is causing a redirect.
Reset permalinks.
Using PHPMyAdmin, search the database for the URL points-to-different-website and see if there is malware or some kind of a redirect, an iFrame, etc.
This can sometimes happen if the server hostname is not set up correctly.
What can happen is website on the server will show in place of a non-existent site or page from another website on the same server.
If you are using a reseller hosting/shared hosting, then the site could be from another account on the server, the site could also be from another server, for example:
There are 2 servers with the hostnames serverone.myserver.com and servertwo.myserver.com... A site on serverone might show in place of a site or page on servertwo.

I have a mess in my head regarding redirect 301,mails and moving to a new website

I'm new to the web world and i have a great mess in my head.
i got a project to build a website for a company and i did.
now this website was built with some cms and i built it with Wordpress.
So now i have to take care that some of the SEO meta tags will not ruin when moving to the new website, i used YOAST SEO plugin to do so.
Now my boss is keeping on asking about redirect 301 which i don't understand why do i need to use it?
if we dont transfer any campaigns and only moving to a new website why do i need it?
another problem is the mails on the domain.
the company has like 5 mails on the domain adress and the domain is sitting on the old company they used to work with,which are not cooperative.
how do i transfer the mails from their servers to a new one?
Thanks a lot.
The 301 redirects are for the newly created Url's.
Because every site has their own way or wwriting url's you need to make sure that you carry across the links to the old urls to the new url structure of the wordpress site.
Example
sitename.com/about_us.html is now sitename.com/about-us/ you will then need to redirect the old about_us url to the new one.
This ensures that any old indexed or shared pages don't server a page not found error.
Very important and can be done using the HTACCESS file or a redirect plugin.

Broken CSS on old https pages

Hi i have a question about importing a wordpress.com site to a new self hosting wordpress site.
After completing the website i still have the old https links in search results showing broken css pages: example here. https://the3growbags.com/author/rhamscallion/
The new website does not use an SSL certificate and adding one does not solve the problem, anyhow we don't need SSL. This is the non-SSL website example: http://the3growbags.com/
Question is why are the old https links showing these broken CSS pages instead of unsecured connection pages, and how do I remove them from search results? help much appreciated.
All your resources are linked using http:// URLs, which result in mixed content which is normally blocked by browsers.
Make sure your resources are loaded using https and your site will work.
For this you could use the protocol agnostic URL style: "//domain.com/path"

WordPress hijacked - all subdomains effected

Just have a question :)
I have a WordPress site with domainname "site.com". It is on its own server.
On another server I have an admin site located on the subdomain "admin.site.com", and a booking site on "booking.site.com" - they are not i WordPress.
Now my WordPress site gets hijacked, and all browser shows a warning, and I'm removed from Google. But it is not only site.com which is closed, but all my subdomains. Why? And is there a way to separate, so the subdomains not will be close if my WordPress site gets hijacked again?
By close, do you mean removed from Google or non-functional in general?
Google doesn't have a lot of forgiveness when it comes to site issues, so afaik it will block the subdomains if the main domain gets compromised.
If your other sites aren't functional, you might want to check your site.com's htaccess file.

How to mask outbound URL in ASP.NET MVC?

I'm trying to redirect and mask all users from a page at my ASP.NET website to another website not using ASP.NET. ie, from www.site.com/site2 to www.site2.com. I want the url to be masked, so that users see www.site.com/site2 in their url rather than www.site2.com, and for subpages like site.com/site2/home to also work. My website is hosted on Microsoft Azure, and I would ideally like to redirect to a completely different page, but could also redirect to another Azure page.
However, I've been getting a bit confused with terminology. What methods can I use to go about this, and is there a specific search term I should be using? There are a lot of resources that discuss doing the opposite (masking part of your website as another site), but fewer masking an outward site as part of your site.
So far, I've found a couple of possible methods - Virtual Directories, and URL Rewrite.
For Virtual Directories, I found this useful blogpost: http://blogs.msdn.com/b/kaushal/archive/2014/04/19/microsoft-azure-web-sites-deploying-wordpress-to-a-virtual-directory-within-the-azure-web-site.aspx
But it doesn't quite work and I'm finding it difficult to find any more resources about Virtual Directories.
I also found URL Rewrite, which looks pretty cool: Mask URL to subdomain using IIS
However, they also mention that URL rewrite only works on the same website, which is not the case here.
Will either of these work to mask site2.com as site.com/site2?
I was not able to do exactly what I wanted to - simply redirect traffic from site.com/site2 to site2.com (and let users see site.com/site2 in the url). URL Rewrite does not do this, but it does do the opposite (map server content at site.com/site2 to user sees site2.com).
Virtual directories are close enough though. I'm actually storing the content at site.com/site2, so users see that as the URL. If I want users to alternately see site2.com if they go there, I can use URL Rewrite.
The first blog post I linked (http://blogs.msdn.com/b/kaushal/archive/2014/04/19/microsoft-azure-web-sites-deploying-wordpress-to-a-virtual-directory-within-the-azure-web-site.aspx) actually is spot on with how to set up Virtual Directories.
One of the problems for me following that post was the Site name and destination URL of the publish settings.
Basically the extension from Azure (outlined in red) matches the URL from publish settings, while the site\wwwroot\wordpress from Azure (green) matches the Site name from publish settings.

Resources