Setting the 404 page without using the NodeId or Guid - umbraco8

I have a webapplication using umbraco which has a page of custom type SinglePageApplication. This content page is on the root:
Content
|
|-Portal (of Type SinglePageApplication)
This page has an Id (for example: 1050) and this page contains an Angular app. What I want is when a url doesn't exist and umbraco should throw the 404, it goes to this page and let Angular handle the page not found situation.
To achieve this, I have changed the error404 configuration in the umbracoSettings.config to this
<error404>1050</error404>
And this works. But soon this web application will be released to live which has a different database and the Portal page probably will have a different Id (and Guid). Obviously, the 404's which umbraco receives will not be forwarded to the right page anymore and I have to change the id manually on the live server. And I would like to prevent that.
The examples in the umbracosettings.config states I can use xpaths and I found many examples when I googled this issue but all were for umbraco 7 and as none of them seems to work for umbraco 8, I got the feeling something might have changed for this setting. Unfortunately, the documentation for umbraco 8 is quite poor currently.
What I have tried so far are:
<error404>//Page[nodeName='Portal']</error404>
<error404>//SinglePageApplication[node='Portal']</error404>
<error404>$site//SinglePageApplication[node='Portal']</error404>
<error404>$root//SinglePageApplication[node='Portal']</error404>
Perhaps I missed one but they didn't work either, all resulted in the ugly 404 page.
What is the way to forward umbraco to a content page when a 404 occured, like it works with using the NodeId but then without being bound to the nodeId or Guid of a page?

You can set the following in the web.config and then set the path variable to be whatever you like.
<httpErrors>
<error statusCode="404" path="/errors/404/" responseMode="ExecuteURL" />
</httpErrors>

Related

Why do I get an 404 Error after using TYPO3 V9.5

I am using TYPO3 9.5 and I created a root page with several subpages.
Before I created a site configuration the subpages were available as
/index.php?id=19
after the site configuration the url has changed to
/events
which is absolutely fine but my subpage cannot be found anymore. I get an 404 Error.
The subpage is still available under the old url but the new one doesn't work.
What can I do to fix this?
after changing the slug(path/path segment) for a page you need to update the slugs for all subpages manually.
The slug is generated automatically when the page is created. Probably your slugs were generated wrong before you build your site configuration.
Try to autogenerate all the slugs with the adapted wizard. You must do it by hand for each page as there is no wizard for page subtrees (yet). you might do the multi-edit in the list module for the slug field.
I have similar issue and no clue how to solve. See TYPO3 9.5 URL Routing with URL Segment is not working
Manual slug override, saving, chache clearance etc. does not help.
Are you using as well Apache? Maybe the issue is related to the webserver.

Change Umbraco 'redirect to' to use 301 instead of 302

I'm using Umbraco 7.0.1 and want to change the default redirect behavior from returning a 302 to return a 301.
So I have a page: /het-obam-perspectief/nieuws/ that redirects to /nieuws/.
I have set this up in the Umbraco CMS:
When the request comes back I get a 302 (as captured in Fiddler):
Is there a way to reconfigure the default redirect behavior? I've looked around the web and only seen instructions for changing redirect behavior when changing domains (stackoverflow.com/questions/16357712/umbraco-301-redirect-entire-site) or managing each redirect url manually (http://our.umbraco.org/projects/developer-tools/301-url-tracker), neither of which satisfies what I'm trying to do.
After doing some research, Umbraco's default behavior for the umbracoRedirect property is automatically a 302, and cannot be changed.
There's (2) different options that we have here.
Configure the redirect in either IIS or web.config for the 301
using URL rewriting.
I found this package (haven't tested nor installed), but looks very
promising. Seems to basially create a new doc type name
umbracoPermanentRedirect and is of type Content Picker, which
then does a 301.
Umbraco Perm Redirect
I'd go w/ option (2) since this is the behavior that acts like Umbraco's default property.
Please let me know how this goes b/c our company heavily uses SEO best practices and I'd get pinged on this 302 as well if I had need for redirects.
Apprec.

Error parsing input URL, no data was scraped. only with new pages on my site

The problem i have is that i own a website where other people can post stuff ,creating new pages on my domain, but the problem that occured today is that all the new post pages created today are malfunctioning , sharing is not loading thumbnail picture and title and so on, but the weird this is that all the posts(new pages) created before today are all working fine
What caused an error to occur out of nowhere?
I also cannot debug any of the URL's of my website as the same error: Error parsing input URL, no data was scraped
The website im having problems with is here http://www.vabameedia.ee/vm/184/h%C3%A4da-ei-anna-h%C3%A4beneda.html
This is one of the sites where it says no error on page but facebook still cant reach it. http://www.vabameedia.ee/vm/178/craig-parks-%C3%BChek%C3%A4eline-krossisoitja.html
For people experiencing the same problem but for different causes, I discovered a few interesting things about how Facebook "scrapes" pages, checking the logs of the server while doing some trials.
First of all: if you never tried to share a page with FB, FB never tried to scrape it, and it will not try to do so if you only put the url in the Debug tool.
That's the first reason because you get the error: it just states that FB has no information on the page, you must "force" it to scrape the page.
The first time you try to share a page, FB scrapes it (asks your server the first 40k of the page and analyse the opengraph tags).
What can happen is that you do not see the image: Facebook Share Dialog does not display thumbnails one first load
The reason is that FB behind the scenes is still scraping your page and caching the image. The next time, in fact, you have also the image.
How to solve it? Pre caching: https://developers.facebook.com/docs/sharing/best-practices#precaching
or simply add
<meta property="og:image:width" content="450"/>
<meta property="og:image:height" content="298"/>
I was pulling my hair out trying to fix this issue. Hours and hours of troubleshooting to no avail. After speaking with one of our programmers about a topic unrelated I thought of something to try as a long shot.
Much to my surprise, it worked!!!
This is the reason behind the problem and my solution for it:
When you draft a post in WordPress it generates a link based on your article's title (unless you manually change it). The title of my article included special characters, however the auto-generated link didn't display these special characters, only hyphens to replace the spaces. Should be fine right? Wrong! Somewhere embedded in metadata and code in the WordPress platform are those special characters and they mess up the way Facebook pulls info from the article being linked to. This is a problem because certain special characters invalidate hyperlinks.
For example:
Article Title: R[eloaded]
Auto-generated hyperlink DISPLAYED in WordPress "Permalink" field: http://www.example.com/reloaded
Actual WordPress Auto-generated hyperlink: http://www.example.com/r[eloaded]
Those brackets will invalidate the link and Facebook will be unable to pull any information (ie pictures) from it.
Solution:
(1) Simply, manually change the WordPress hyperlink address to something that doesn't include any special characters (this will not change the title of your article).
(2) Click "Update" to change the post to include the new hyperlink.
(3) Click "Purge from Cache" in the WordPress window
(4) Refresh your Facebook browser window
(5) Paste the new hyperlink for your article
(6) Enjoy your Facebook post with a preview image and information
Sidenote: Don't pull your hair out over Facebook, it's not worth it. =)
If you're using Wordpress, edit the post in question to change the permalink (just alter it slightly), then update the post. Using the new permalink in the Facebook OG debugger should now work.
It's a weird fix, but I think it takes care of a problem caused by special characters being used in the title of a post, which is then used to make the permalink.
Its all about DNS issue, was having same issue and resolved it by updating domain name servers to actual name servers.
In my case my domain was pointed to ns1.websterz.net and ns2.websterz.net and on this server i had DNS redirect to my other server (where web site is hosted). I Just updated name servers of the domain to actual name servers where my web site is hosted on. This was account migration case i forgot to update name servers as of new server.
Everything works fine now.

Redirects in Ektron 8.6.1

Has anyone played with the new redirect feature in Ektron 8.6?
We tested it (in 8.6.0) before upgrading and were happy with it. But when it came time to do the upgrade, Ektron had released 8.6.1, so we upgraded directly to that.
Now we are having trouble with the redirect feature. (Yes, we should have tested everything again in 8.6.1 before upgrading)
Now if we try to add a redirect rule for an existing page in the CMS, it does not work.
But if we create a redirect rule for a page the does not exist, then try to hit that address, the redirect works fine.
We need the redirects to work for existing pages in the CMS.
To clarify what "working" and "not working" means...
If I have an existing page in the CMS with manual alias of "/erc/lucien.apsx", I can create an entry in the redirect table like this...
Adding this entry generates no errors, but when I visit the page, all I see is the regular old page I created. NOT the Google site it should be redirecting to. I do not get any 404 errors.
But if I create a redirect entry for a page that does not already exist, like this...
It works perfectly. If I try to visit the /erc/fake.apsx address, I end up on the Google site, as expected.
(FYI, we create a "fake" page in the CMS for external content so we can attach metadata to it and make it searchable in taxonomies, but then provide a link to the "real" page. I want to use redirects here so users don't have to do this extra click)
I suspect it might be cache related -- the original URL gets cached as an alias, then subsequent requests to that URL are redirected to the quicklink without the need for a db look up. When you add the redirect, it’s probably not clearing the old item from the cache. I'd try an IIS reset after you add the URL redirect and see if that clears up the issue.
An "outside the box" (of Ektron) answer to this is to place the redirect at the web server rather than in the Aliases section of the Ektron CMS.
The server I work on uses IIS and I have this set up for several pages.

How can I pull in my BlogSpot page into a page on my web site

I have a blog on BlogSpot.com, and I have a domain based on my own name. I want to have a URL on my site (like http://www.mydomain.com/blog) that will then pull in the content from my blog page, but I want the URL in the address bar to stay on http://www.mydomain.com/blog, so that it does not look like you left my site.
(I have a Windows hosting account on 1and1.com)
I did Google this question, and I found how a few things, like:
1: Adding a tag in to "refresh". Tried this, but it changes the address bar.
<meta http-equiv="refresh" content="0; URL=http://myblog.blogspot.com" />
2: I also learned about the html iframe thing, but it has height and scrollbar issues.
3: Then, I found this partial code snippet, but I don't know what to do with it, or if it will even work against the BlogSpot server, or on my server:
<%
Set objHTTP = Server.CreateObject("Microsoft.XMLHTTP")
objHTTP.Open "GET", "http://myblog.blogspot.com", false
objHTTP.Send
Response.Write objHTTP.ResponseText
%>
I am a client app guy, so this web stuff is all new to me.
Any help will be greatly appreciated.
The third option will probably work for the initial page load, but any links on the page will then direct the user to the BlogSpot page, and change the url. It simply fetches the page from blogspot, and then sends it to the user without any changes.
For me, the changing url is not a big deal, as long as it's easy for the user to get from one to the other easily; have prominent links on either page that tell the user where they go. Most people don't care about the url, they just care about the content.
Using an IFrame is probably your best bet. Many Facebook applications are in IFrames and still integrate very well.
I think using a regular frame or an iFrame is probably the easiest solution. What kind of scrollbar issues did you encounter? You can set custom values for some of these attributes, just check out the documentation here:
http://www.w3schools.com/TAGS/tag_iframe.asp
If you didn't want to use frames, you could actually proxy the entire page using a server side application like Squid. However, this is more difficult to setup, requires the ability to install software and configure firewall/iptable settings on your host, and must be configured properly to prevent malicious abuse.
-Mark
Here are some options you can try:
If you have PHP installed:
<?php
echo file_get_contents('http://myblog.blogspot.com'); // or you can use fopen()
?>
Or Server-Side-Includes installed:
<!--# include virtual="http://myblog.blogspot.com" -->
You can also pull blog content from Blogspot using the Blogger Data API.
The advantage of this is that you can reformat and reorganize the content to match the style of your website. The disadvantage is that it's more work than an iframe, and you probably won't match the full functionality of Blogspot.
I'm playing with this now to see whether I can use Blogspot as a type of CMS for a club news system.