Is it possible to hide URL trail? - asp.net

Problem is simple, I have a web site www.mydomain.com which have other links to other pages (in the same site) like www.mydomain.com/some/directory/some_page.asp. I would like to know if it's possible to hide the second part and show only the www.mydomain.com.
I'm using DotNetNuke, IIS web server.
Is it possible to do this with the url_rewrite module?

Do you want all the URLs to show up in the browser as just the domain? the only way to do this would be to use an Iframe, which is a TERRIBLE idea. It means that no one can copy and paste your URLs to send to their friends, and if they just get the URL anyway because they know how to use a browser users will see the full path anyway.
The url_rewrite module won't do what you're after either. It can rewrite one URL to another, e.g. instead of www.mydomain.com/mypage.asp you could have www.mydomain.com/mypage. But you couldn't map ALL of your pages to just the root domain (think about it, how would it know which of your pages to serve up for that URL).
This is something people used to ask for back in the 90's. It was a bad idea then, and it's an even worse idea now.

Related

Problem with Page has redirected JavaScript

I did an audit of my website and it sends me this message
"Page has redirected JavaScript"
Issue details
Some pages on your website link to JavaScript files via a redirect.
This forces web browsers and search engine crawlers to make an additional HTTP request in order to reach the destination JS file URL. On a vast scale, this can increase page loading times for your website.
How to fix
Review the pages that have a link to the redirecting URL and replace this link with the direct link to the destination JS file.
If you decide to keep links to redirecting URLs that do not belong to your website, make sure that the destination files are relevant.
And I get several links like these:
https://script.crazyegg.com/pages/scripts/0012/9265.js
https://s7.addthis.com/ with randoms numbers
Has anyone had a similar problem who can help me to see how to solve the problem?
It sounds like you have some pages that are actually loading a remote JS file, which then redirect to another page on your website.
Why this is happening is anyone's guess - maybe you have a plugin installed that is doing it intentionally as part of it's functionality. I would start by disabling plugins one at a time (ideally on a staging environment) until the problem goes away, and then you'll know who the culprit is and make a decision.

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.

Why do a redirect, and an A record result in different media queries on the same device

I have a website hosted via github pages which uses two domain names. The first I configured as an A record using the GitHub instructions. The second I configured as a redirect using name.com's redirection service. This seems to work for the most part. However, when I visit the second domain via my iPhone the media query doesn't seem to work as expected. What is happening here, and is there a way that I can point the two domains at the one location without breaking the media queries like this?
Sorry for the large images, but I had some trouble finding a good way to show them side by side in markdown.
The redirect made by name.com isn't an actual redirect; they simply opens a frame to http://roblockyer.com. As of such, the meta viewport rules aren't considered on http://robertlockyer.com.
I must question why you have two different domain names though. Search engines don't look friendly upon identical websites under different domain names. You should decide on one and stick to it.
If you really want you site to be accessible from two domain names, then do a 301 Redirect through a .htaccess-document from one to the other should be both the best and the easiest way since it seems like the two domains are on different server spaces.
So, if you're on an Apache server and want to redirect users from robertlockyer.com to roblockyer.com, then all you need to do is add this to the .htaccess-document on the server space hosting robertlockyer.com:
Redirect 301 / http://www.roblockyer.com

Cons and Pros of Protocol-Less-Urls "//example.org" vs "http://www.example.org"

As I am uncertain yet which version to settle with http://www.exampe.org OR http://example.org (eventually I have to choose but for now I cannot choose). Meanwhile I want to promote my site online: post a link here or there. Now, I was wondering whether it would be a good idea to have a protocolless hyperlinks e.g. //example.org as URL!
That way the urls on the net wont be picky and allow some space to be good for both with or without www. Its simpler smaller and it seems to work fine in FireFox!
Questions
1.What are the pros and cons of using protocollless Urls?
2.Why aren't other folks using them?
Thanks! Very curious to your insights. Much appreciated.
The main reason to use these URLs are in a site that uses both HTTP and HTTPS (with the same page). The idea being that links to static content on the page use // instead of http://, inheriting the protocol from the page. This allows the client to add the correct protocol (so secure pages don't have "insecure items" on them) and removes the need to code two versions of the page or have special "tricks" to change the protocol when the page is generated.
For any URL outside of this, not adding a protocol will mean that users may directly come to your site with an HTTPS request, adding unnecessary load to your site. I suggest explicitly specifying the protocol in such cases.
As for the issue of using www or not - it depends on what else you will have on the server and if you expect subdomains (if you add a blog, will it have a blog.example.com URL or an example.com/blog URL). If you do expect subdomains, use www to signify main site, if you don't you can omit it.
With regard to using www.example.com or example.com for a website, there are good reasons to use both. Some argue that the only real thing people will be using your domain name for is to go to your webserver, thus www. is considered redundant by those of that opinion.
I personally prefer www.example.com as one can create a CNAME record for that. This is useful if you ever want/need to put a website behind a CDN, as root domain names cannot be CNAMEs.
In either case, you would most likely want the one you are not using to give redirects to whichever you are using so regardless of where a user hits they will get to the server.
As for why people don't use //example.com or //www.example.com my guess would be:
The thought of a link without a protocol is scary and seems odd...
Most markup parsers probably don't recognize it, either.

Wordpress, why doesn't my blog load the posts if U use the /subfolder domain method?

I have a blog at http://hamids-it.elaosta.com amongst others. If I try to access it from
http://elaosta.com/hamids-it it loads the blog but says it couldn't find the page I wanted.
How do I fix this so I can use either?
I'm guessing you have a standard subdomain install, whereby http://subdomain.example.com is mapped to the directory /example.com/public_html/subdomain?
In any normal circumstance, say with a static HTML file, you can rightly access the same resource at both example.com/subdomain/resource.html and subdomain.example.com/resource.html.
However, in your case, WordPress is parsing the REQUEST_URI and using it to determine what to show.
So in the case of http://elaosta.com/hamids-it, WordPress is actually looking for a page 'hamids-it' - and if it doesn't find it, voila, your 404.
The fix?
You'll need to decide which way you want to access your blog, subdomain or sub-directory, then stick to it.
When you've made a choice, update your General settings in WordPress admin and set both address URL's to either http://hamids-it.elaosta.com or http://elaosta.com/hamids-it.

Resources