Issue with startitem in Sitecore - url

We have four different environments - dev VMs, dev, QA and prod. All environments have the following setting for the "website" site:
<site name="website" virtualFolder="/" physicalFolder="/"
rootPath="/sitecore/content" startItem="/home" database="master"
domain="extranet" allowDebug="true" cacheHtml="false"
htmlCacheSize="10MB" registryCacheSize="0" viewStateCacheSize="0"
xslCacheSize="5MB" filteredItemsCacheSize="2MB" enablePreview="true"
enableWebEdit="true" enableDebugger="true"
disableClientData="false" loginPage="/" hostName="www.site.com"
enableFallback="true" enforceVersionPresence="true"/>.
So on VM and prod, www.site.com/en/home/press and www.site.com/en/press work.
But on dev and QA, www.site.com/en/home/press works but www.site.com/en/press doesn't work. (Works with startItem but gets a 404 without it).
This is happening with ISAPI enabled and disabled both (no exceptions).
I am not sure what is going on here or where else to look except to make sure that my start item is in good shape which it seems to be.
What can I do to resolve this? If you need more information please let me know.
Thanks

Try looking at the:
"linkManager" tag in the web.config, there is a property called:
languageEmbedding: asNeeded | always | never
which could be set differently on those solutiuons.

If you have Multi-Language website it is recommended to go with
languageEmbedding: always
Advantages :
Some time in IE8 the Language cookie is destroyed, because of that
the language displayed is change randomly.(We have faced this issue
in our environment) LanguageEmbadding : Always will keep the Information and will work without any Issue.
If you have set asNeeded then First time the Language will be displayed and next time onward it will be hidden. But this will create issue with Google Analytics. In GA you will have 2 diff URL with same page content so your analysis will be unnecessarily divided in to 2 pages.
And Yes you can check if there is any difference is Config files. As Mentioned by Martijn you can use the www.site.com/sitecore/admin/showconfig.aspx Copy the Config, compare it using any file compare tool like WinMerge etc.
What is the Hierarchy in your project?
Sitecore-Content-home-Press or
Sitecore-Content-home-Home-Press?
In my project the setting you have mentioned has database = web.

I can't add a comment, but as Martijn says you need to compare the configs. Now this should be very easy since you should be using config include files and so the changes between the environments should be very minimal. If you are not using them then you should start using them, it makes life much easier to figure out the differences from default Sitecore installation and will also make your upgrades much easier in the future. Or maybe you are using them for the other environments and that is what is causing the issue?
All About web.config Include Files with the Sitecore ASP.NET CMS
As for comparing the configs, use a file comparison tool like WinMerge as already metioned, that should weed out the differences much more easily.
Also, as Maulik says, default config has: database="web" content="master"

This seems like config differences. Compare the live configs by using www.site.com/sitecore/admin/showconfig.aspx. This way you can see the actual config which also includes all your /app_config/include/ files

Related

Updating Grails 4+ configuration values during runtime

In Grails 2 we used the "External configuration plugin", which included the method checkNow() for checking and refreshing values from an external config file.
Does it exist a simple approach for doing something similar in Grails 4+? I have seen references to Spring Cloud Config Server, but it seems a bit overkill for me. All I really want to do is be able to (now and then) update a config value in runtime. It could also be purely by a few lines of code, and does not have to originate from changes in the config file. This would avoid having to restart our server for minor changes in config. Thanks!
I'm replying to myself with a ridiculously simple answer: "just change it". Using the console plugin (or any other form of code execution), I can just assign grailsApplication.config.any.property a new value. It won't persist and it won't update any listeners or anything. But it is a glaringly obvious solution that I just assumed wouldn't work due to the getProperty() calls (I interpreted the name as reading from file) and googled discussions about Spring Cloud Config.
So, move on... nothing to see here. Just mild embarrassment :-P

grails URL not containing app.name on one system, but showing up fine on another

We have two QA sites: they should be identical, but their generated links behave differently.
On one case, the generated links contain the app.name. In the other case, the links do not contain the app.name and are failing with a 404 error.
good link: devici1/appName/controller/action
bad link: devici2/controller/action <-- notice the missing appName
Now here is what is weird:
Both systems are running the same version of code, the links are
generated using g.createLink(controller: entry.controller, action:
entry.action)
We do not set app.context anywhere that I know of.
It is not in application.properties, config.groovy, or the
icw-config.groovy (local override file).
Both systems set app.name in application.properties
grails.serverUrl is not set (we stopped using it more than a year ago)
Further, this may have been going on for several months and no one noticed it on the bad system, so there is no recent change I can go looking for.
Does anyone know the logic used by g:createLink to determine when the app.name should be included or not? Any suggestions for variables I should make sure are set or not set would be most appreciated!

Managing web.config variations on different workplaces

I'm not sure if title is good for a problem I'm facing, so feel free to correct it if there is better term for that situation.
Basically I'm struggling with the follwing problem. I work on a project on two different workplaces. The problem is that I have two different connection strings in my Web.config file because I have different server names. So it's a pain to work under source control.
So I've tried to use config transformations, but they only work then you do publish, and not then you run locally with F5. Is there any solution for this?
Here's a nice extension that should do it: SlowCheetah

Modifying Grails apps post deployment

I'm investigating Grails vs. other Agile web frameworks, and one key use case I'm trying to support is the ability to modify controllers and install plugins post deployment. It appears that this isn't possible with Grails, but I want to make sure before I write it off.
As far as modifying controllers goes, it would be sufficient if the Groovlet behavior existed (compile-on-demand).
As far as plugin installs go, I understand this may be a long shot, but I thought I'd check to be sure.
For your information, I need this because I work on a product that requires a little site-specific customization, such as adding validation of simple meta-data, integrating with customer security environments, and maybe even including new controllers/pages quickly.
Out of the box, no, grails doesn't really support what you want. There may be ways to customize it but I've never looked into it. A PHP framework might be more of your ally since there is no real deployment process other than copying PHP files to a location.
That said, I personally would prefer a strict set of deployment policies. And honestly, deploying changes with Grails is as simple as running the 'grails war' command and copying that war to your servlet container. The site's downtime is negligible and if you have multiple web servers with a load-balancer, your customers should never see down time due to deployments.
Although it's not recommended for complex coding; You could execute groovy code from a string that you could store in database or a file on the fly at run time:
check out Groovy template engine:
http://groovy.codehaus.org/Groovy+Templates
but even then, you are still limited on what you can do or can't do let alone debugging will lack. you may want to consider an interpreted language; few to mention PHP/Perl/Coldfusion.

Switch between development version and live version

Does anyone have any good techniques for easily switching between development and live builds for asp.net mvc websites? Every time I make some changes I need to change to go through my web.config and comment out all my local stuff and uncomment all my remote settings. I also need to update the linq-to-sql dbml file to point to the right connection string.
This happens every time I make a change in a controller. After I upload the changes I then have to do the same process and get it back to development (local) mode.
Is there an automatic way to handle this, or at least one setting that can flag between the two?
Thanks
a way I've done is to make two groups of configuration settings
<LiveSomeSetting>something</LiveSomeSetting>
<TestSomeSetting>anotherthing</TestSomeSetting>
Then in my class that reads configuration info, I'd check on something like the system environment / computer name and if applicable to the name of your LIVE machine look at the settings... otherwise the development.
if (System.Environment.MachineName.ToLower().StartsWith("devMachineName"))
IsLive = "Test";
else
IsLive = "Live";
Application["IsLive"] = IsLive;
SomeSetting = ConfigurationManager.AppSettings[IsLive + "SomeSetting"];
I use a simple technique that Scott Hanselman blogged in '97. It basically involves maintaining separate web.config files for each of you build types. Then there is a pre-build event which copies the correct web.config into place.
It does have the down side of having to maintain 2+ web.config files but once you're up and running it isn't really that big an issue.
Have a look here at the article:
Managing Multiple Configuration File Environments with Pre-Build Events
HTHs,
Charles

Resources