I have installed Redirect module in sitecore. Inside modules I have created "Redirect Url". In Redirect Url I wrote Requested Url "http://domainname/pagename" and selected Redirect To from content. But it is not working. Can anyone tell me what is wrong I am doing?
I have created redirect pattern.
It all depends on which module implementation you are using. I have heard multiple complaints on functional of original one (seems it is discontinued at all), so people are doing their own forks. The best implementation for the day is by Chris Adams and Max Slabyak, the module with sources, packages as well as good documentation is available at GitHub and it is being maintained with time.
With that Redirect Module installed, I do the following:
Under /sitecore/system/Modules/Redirect Module folder in Sitecore create a new redirect pattern called Pagename Test
Set requested expression to ^/pagename/?
Leave response status code equal 301
Set source item to the actual page item serving that redirect request
Do not forget to publish redirect pattern (and module itself if not yet)
Then as I hit http://myhostname/pagename/ I am being redirected to desired page with 301 status code.
Hope this helps and please let us know if that worked out for you.
Related
In sitecore, we made a 301 redirect of an existing page to an external page(another domain) using redirect module. It did not work when we tested as the internal page kept loading. But when we deleted the internal page the redirect worked. So is it necessary that a page do not exist for the 301 redirect to work in Sitecore? Is that also the definition of 301 redirect?
I'm not sure which of the redirects module you used. As far as I know, there is no "official" redirect module from Sitecore (except from what is a part of SXA), but there are multiple redirect modules available e.g. on Sitecore Marketplace.
Most of them works in a way that first Sitecore checks if it can handle the request and only if the Sitecore page (item) does not exist, the redirection part is processed.
I believe it's the same in your case. You wrote that you had to delete the page. If what I wrote above is correct in your case, I believe you could unpublish item (by setting publishing restrictions and publishing restricted item) or rename (and republish) the item instead of deleting it.
In my sitecore instance, (8.2 rev 170407), I'm having an issue viewing the homepage in both my dev enviroment and my staging server. Going to the homepage (the root of the server) redirects to this URL
http://[website]/sitecore/service/nolayout.aspx?item=%2f&layout=%7b00000000-0000-0000-0000-000000000000%7d&device=Default
The message says:
The resource you are looking for (or one of its dependencies) may have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Additional Information:
Requested URL: /
Requested Layout: {00000000-0000-0000-0000-000000000000}
Requested Device: Default
In testing this, I set the Home item to have an alias of /home, which I can visit and see the page looking fine.
This issue began when I set up Helix via the Yeoman script, and built it in VS2015. This is my first Sitecore Site so I handily accept that I made a mistake -- for example when I built the Solution for the first time it overwrote my Web.config. I had a backup of that Web.config and was able to bring the site back online but the Homepage has eluded me.
I've published, and republished. In my naive experience, I find it odd I can see the homepage at /home but not /. Any advice is appreciated, thanks.
we created multilingual website in FR, ES, EN from old classic asp website( which was also in 3 languages). In Old site by default in English language "en" was not embedding in the URL. but in our new sitecore website i have language Embedding="Always".
So when we redirect from old website to new website for 301 redirects in Google, if i opened my new website in French language and redirect from old site is in English ( which means that in the url there is no language i.e "en") link will point to french version).
So how could i add "en" to the url .
HttpContext.Current.Request.RawUrl
i can use above to get the raw url but i am not getting how to display "en" in the browser url.
old website links:
www.abc.com/xyz.asp,
www.abc.com/fr/xyz.asp,
www.abc.com/es/xyz.asp
new website links:
www.abc.com/en/xyz.aspx,
www.abc.com/fr/xyz.aspx,
www.abc.com/es/xyz.aspx
thanks
How did you handle the language in the old website? How did you know a user was requesting a page in EN/FR/ES?
Since you are redirecting with a 301 from your old site you need to handle the language embedding into the URL from your old site. Handling it from the Sitecore side will add best only give you a "prettier" URL, with the added downside of having to add in another 302 redirect to the same page after you have inspected with the redirecting has the language embedded or not. Ruud's suggestion to use IIS Rewrite is a good one.
So when we redirect from old website to new website for 301 redirects
in Google, if i opened my new website in French language and redirect
from old site is in English ( which means that in the url there is no
language i.e "en") link will point to french version).
Yes, this is how Sitecore works, it uses cookies to persist the last selected language, but context language is set in the following order. Your initial visit would set the language cookie.
The sc_lang query string parameter.
The language prefix in the path in the requested URL.
The language cookie associated with the context site.
The default language associated with the context logical site.
The DefaultLanguage setting specified in web.config.
Overriding Sitecore’s Logic to Determine the Context Language
If you really don't want the language persisted between browser sessions then override the Sitecore.Pipelines.HttpRequest.LanguageResolver pipeline with your own logic to either NOT set the cookie (in which case you are totally relying on the request URL) OR set a cookie that will expire when the browser is closed. You can find an example from this blog post as well as an example in the previously linked John West blog post.
If your only concern is Google indexing, then I would probably not make any changes except add in a canonical link tags on your pages with the full URL including language (this will obviously be different for each language version).
<link rel="canonical" href="http://www.abc.com/en/xyz.aspx"/>
I don't know exactly what you're asking here, but if you need the URL with language embedding for a specific Sitecore item, you just need configure languageEmbedding="always" for the link provider and then request the item's URL with the LinkManager:
Sitecore.Links.LinkManager.GetItemUrl(item);
If you need the URL for a specific language or explicitly set the languageEmbedding option in your code, you can set that in the UrlOptions:
var options = Sitecore.Links.LinkManager.GetDefaultUrlOptions();
options.LanguageEmbedding = Sitecore.Links.LanguageEmbedding.Always;
options.EmbedLanguage(Sitecore.Globalization.Language.Parse("en"));
Sitecore.Links.LinkManager.GetItemUrl(item, options);
Hope that helps!
Take a look at Sitecore.Pipelines.PreprocessRequest.StripLanguage...
I'd overwrite this one, if no language is found using the existing function, I'd default back to en.
You can use URLOptions for this please see below code -
protected UrlOptions URLOptions
{
get
{
if (urlOptions == null)
{
urlOptions = new UrlOptions()
{
LanguageEmbedding = LanguageEmbedding.Always,
AddAspxExtension = false
};
}
return urlOptions;
}
}
Please pass this URloption object in geturl() function it will work.
LinkManager.GetItemUrl(itm, URLOptions)
You can achieve this functionality by a sitecore setting.
Please refer above screenshot. Change languageEmbedding property to always from asNeeded This setting is done in Sitecore.config file. Please let me know if this helps you fulfill your requirement.
I have had WFFM running on a Sitecore instance for a while, but it has recently stopped working. When I go to "Form Designer" on an existing form, I get the standard Sitecore "The requested document was not found" page.
Requested URL: /applications/modules/web
User Name: sitecore\admin
Site Name: shell
If the page you are trying to display exists, please check that an
appropriate prefix has been added to the IgnoreUrlPrefixes setting in
the web.config.
Note that the requested URL is stated as /applications/modules/web instead of /applications/modules/web forms for marketers.
A lot of development has occurred on this site recently, so I'm not sure when exactly this started happening.
Additional: info:
Folder and file permissions are correct.
I've tried reinstalling the WFFM package, and made sure that all the files are in place.
Several processors have been added to the HttpBeginRequest pipeline, but I removed them all to test if they were the cause - they weren't.
I haven't upgraded Sitecore since WFFM was working and the version is correct.
No errors are logged
EDIT
This also seems to be affecting the Sitecore Security Editor:
Requested URL: /appl
User Name: sitecore\admin
Site Name: shell
If the page you are trying to display exists, please check that an
appropriate prefix has been added to the IgnoreUrlPrefixes setting in
the web.config.
EDIT 2
Further investigation with this is making me think it is related to the Requested URL. I originally thought the the "Not found" page was displaying the requested url incorrectly. However, if I attempt to goto mysite.com/sitecore/shell/applications/fake folder with spaces/fake page with spaces I get this error message:
Requested URL: /applications/fake folder with spaces/fake page with
spaces
User Name: sitecore\admin
Site Name: shell
If the page you are trying to display exists, please check that an
appropriate prefix has been added to the IgnoreUrlPrefixes setting in
the web.config.
As you can see the Requested Url is correct in the error message. So in relation to my problem, I think maybe Sitecore is requesting the wrong URL in the first place.
Additionally if I go to the go the following url by typing directly into the browser, then the Security Editor opens as expected:
mysite.com/sitecore/shell/Applications/Security/User-Editor
This is quite old now but I thought I'd provide an update for anyone else who encounters the problem.
Unfortunately, Sitecore support weren't able to help beyond pointing out that setting the addAspxExtension attribute to 'true' in the link provider seemed to solve the problem. This may have been acceptable except that extensionless URLs were important to the customer.
In the end I had to amend my link provider so that addAspxExtension is set to 'true' in the web config, and then I set it to false inside the GetItemUrl method for specified sites only.
So now whenever the context site is 'Shell' or 'Admin' etc, the extensions are added by default, but switched off in my main website.
Of course, this is a work around. I still don't know how to actually fix the problem
So the first thing that I am going to tell you is that I suspect that there is something wrong with your site declaration for Sitecore Modules. In your web.config, there's a site declaration for "modules_shell" and "modules_website". Those are where the code files that run the modules are usually located... a shell folder to run the parts that run in the Sitecore shell and a web folder to run the part that is accessed by the externally facing site. Please check your site declarations (and the form.config file) to make sure that you're not in live mode or something like that. I would definitely say that this is where you should start looking.
The next thing is to say that your comments about Sitecore not serving a url in the /sitecore/shell directory is really not surprising. Sitecore processes all requests unless you specifically tell it to ignore requests (like setting it in the IgnoreUrlPrefixes in web.config), it's going to try processing it. Like going to /sitecore/shell/applications gives me a layout error because it doesn't have anything set to handle that request. Now your error suggests that there is something wrong with Site declarations.. however, even if they were all right, it still wouldn't work.
I've been asked to help out with some ColdFusion development and one of the tasks will be to undertake url re-writing, mostly turning url parameters into a cleaner url.
The site is on a hosted service with cf8 running on iis, with Helicon Tech ISAPI_Rewrite v2.
Are there any things I should look out for?
Thanks.
This should be fine. IIS (or the ISAPI addin) deals with the URL rewrite and then passes it onto CF as if it were requested as the original URL.
Most people do URL rewriting in order to improve their SERP rankings - key to this is making sure that the original URL that was in place previously now returns a 301 (moved permanently) redirect to your new URL. This preserves the 'link juice' associated with the old URL. Don't use CFLOCATION to do your redirect - that tag does a 302...
I've been using ISAPI_Rewrite and ColdFusion for a few years and had good results.
I would recommend upgrading to version 3 if you can. While version 2 worked fine, I've found the latest version easier to use because it's compatible with mod_rewrite.
The bottom line is that a URL Rewriter and your Application Server (ColdFusion or otherwise) should never have problems working together. If they are, you've probably setup your rewriting rules incorrectly (or are using a crappy rewriter).
The URL Rewriter changes the appearance of the request before it is handed off to the Application Server. As long as the end result is foo.cfm?var=value, whether that be the actual URL or the result of rewriting, it will be fine.