Url For multilanguage

Jan 2, 2014 at 1:36 PM
Hi Sancha,

In my website i have 3 languages (en-GB, french, russian)... when i install OpenUrlRewriter71_01.00.01_Install.zip to my website, installation works fine but i cant access any page. It shows page cannot be found. i wont be able to access any page...

i need to replace web.config file to get into page... do you have any idea. is there any setting i am missing? any help will be appreciated..

Regards,
Geo
Coordinator
Jan 2, 2014 at 1:49 PM
Hi,

Not easy to tell what wrong ...

You can not access the website without a page name ?
On witch version of dnn are you ?

Do you already are in urlformat=advanced before installing open url rewriter ?

Maybe a problem with your portal aliases.
Normally, in advanced mode, you need one portal alias for each language.

Regards,
Sacha
Jan 2, 2014 at 2:01 PM
Edited Jan 2, 2014 at 2:24 PM
Hi Sacha,

i am using dnn 07.01.01

i had multiple portal aliases. i removed all and keep to only one. and then tried install open url still having the same problem..

http://cdgbrand.com/Home/tabid/56/language/en-US

you can have look for https://cdgbrand.com

Regards,
Geo
Coordinator
Jan 2, 2014 at 3:22 PM
Hi ,

I have try to look at it.

But then a had an error .

Now i think you uninstall open url rewriter.

Regards,
Sacha
Coordinator
Jan 2, 2014 at 3:23 PM
Hi,
If you want i look at it, tell me when it is installed.

And can you also send me your web.config by mail sachatrauwaen [at] yahoo.com
(after install)

Regards,
Sacha
Jan 2, 2014 at 3:47 PM
Hi Sacha,

i reinstalled open url rewriter and send the web.config file to ur yahoo account...

Can you have a look and let me know?

Thanks a lot
Geo
Coordinator
Jan 2, 2014 at 4:04 PM
Hi,

Can you try to modify the file extension to see if it it related the file extension.

Change in next line
<add name="OpenFriendlyUrl" type="Satrabel.Services.Url.FriendlyUrl.OpenFriendlyUrlProvider, Satrabel.OpenUrlRewriter" includePageName="true" regexMatch="[^a-zA-Z0-9 _-]" urlFormat="advanced" fileExtension="" />
fileExtension=".aspx"

Tell me if it works.

Regards,
Sacha
Marked as answer by geoneeliyara on 1/3/2014 at 4:55 AM
Jan 2, 2014 at 4:14 PM
Hi Sacha,

Thanks a lot it is working now...

Regards,
Geo
Coordinator
Jan 2, 2014 at 4:20 PM
Hi,

To solve this problem for urls without extensions, you can install the microsoft patch

http://support.microsoft.com/kb/980368

But i see the urls are not correctly rewriten ?

Maybe you miss the aliases for each language ???

Regards,
Sacha
Jan 2, 2014 at 4:29 PM
Hi Sacha,

i am using one site alias for all language...

Can you please tell me exactly what i need to do?

different alias means we need 3 portals?

can you please tell me step by step procedure?

Regards,
Geo
Coordinator
Jan 2, 2014 at 5:48 PM
Hi,

You need 1 portal with 4 aliases.

1) alias = cdgbrand.com - languange = empty
2) alias = cdgbrand.com/fr - languange = fr-Fr
3) alias = cdgbrand.com/en - languange = en-GB
4) alias = cdgbrand.com/ru - languange = ru-RU

(it's in site settings, site aliases)

Regards,
Sacha
Jan 3, 2014 at 9:09 AM
Hi Sacha,

i done the following settings in site alias

Image

still url looks clean... can yoy have a look? Any setting did i miss?

http://cdgbrand.com/en/Home/tabid/56/language/en-US.aspx

Regards,
Geo
Coordinator
Jan 3, 2014 at 10:44 AM
Hi,

It's all right.

But something is not working ok.
The generated urls of the menus are not rewriten.

Can you look in the admin module and look in cache to see if you find the rules for the pages.

Otherwise send me a host acount by mail at sachatrauwaen [at] yahoo.com to have a look.

Regards,
Sacha
Jan 3, 2014 at 11:05 AM
Hi Sacha,

i send the details to your yahoo account..

Please have a look and let me know?

There is no rules for pages

Regards,
Geo
Coordinator
Jan 3, 2014 at 11:50 AM
Hi,

It was only the TabUrlRuleProvider in the admin module which was disabled.
Normally it is enabled by default.

Now everything rewrite correctly.

Regards,
Sacha
Marked as answer by geoneeliyara on 1/3/2014 at 4:54 AM
Jan 3, 2014 at 11:55 AM
Hi Sacha,

Thanks a lot....
Jan 3, 2014 at 1:12 PM
Hi Sacha,

i have two more problems...
  1. when you are in home page( russian or french), click on en-GB flag it doesnt change the language?
  2. i need url provider for portfolio but it is not working? is that because of multilanguage? i will attach what i done
Step A. Create a new folder in App_Code/CDG.UrlProvider/
Step B. Editing web confg
<urlRule defaultProvider="PortfolioUrlProvider">
      <providers>
        <clear />
        <add name="tabUrlRuleProvider" type="Satrabel.HttpModules.Provider.TabUrlRuleProvider, Satrabel.OpenUrlRewriter" useKeyWords="true" />
        <add name="userUrlRuleProvider" type="Satrabel.HttpModules.Provider.UserUrlRuleProvider, Satrabel.OpenUrlRewriter" />
        <add name="ctlUrlRuleProvider" type="Satrabel.HttpModules.Provider.CtlUrlRuleProvider, Satrabel.OpenUrlRewriter" />
        <add name="PortfolioUrlProvider" type="CDG.UrlProvider.PortfolioUrlProvider" includePageName="false" />
      </providers>
    </urlRule>

<codeSubDirectories>
        <add directoryName="CDG.Portfolio" />
        <add directoryName="CDG.UrlProvider" />
      </codeSubDirectories>

using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Collections;
using System.Collections.Generic;
using DotNetNuke.Common.Utilities;

using DotNetNuke.Entities.Modules;
using DotNetNuke.Framework.Providers;
using Satrabel.HttpModules.Provider;
using CDG.Modules.Portfolio;
//using DotNetNuke.Modules.dnnsimplearticle.Components;
//using DotNetNuke.Modules.dnnsimplearticle.services;



namespace CDG.UrlProvider
{
    public class PortfolioUrlProvider : UrlRuleProvider
    {

        private const string ProviderType = "urlRule";
        private const string ProviderName = "PortfolioUrlProvider";

        private readonly ProviderConfiguration _providerConfiguration = ProviderConfiguration.GetProviderConfiguration(ProviderType);
        private readonly bool includePageName = true;

        public PortfolioUrlProvider()
        {
            var objProvider = (DotNetNuke.Framework.Providers.Provider)_providerConfiguration.Providers[ProviderName];
            if (!string.IsNullOrEmpty(objProvider.Attributes["includePageName"]))
            {
                includePageName = bool.Parse(objProvider.Attributes["includePageName"]);
            }
            //CacheKeys = new string[] { "DNNSimpleArticle-ProperyValues-All" };
        }

        public override List<UrlRule> GetRules(int PortalId)
        {
            List<UrlRule> Rules = new List<UrlRule>();
            PortfolioController objCtrl = new PortfolioController();
            ModuleController mc = new ModuleController();
            ArrayList modules = mc.GetModulesByDefinition(PortalId, "Portfolio");

            //foreach (ModuleInfo module in modules.OfType<ModuleInfo>().GroupBy(m => m.ModuleID).Select(g => g.First())){                
            foreach (ModuleInfo module in modules)
            {
                var Portfolios = objCtrl.GetPortfolioList(module.ModuleID);
                
                foreach (var portfolio in Portfolios)
                {
                    var rule = new UrlRule
                    {
                        CultureCode = module.CultureCode,
                        TabId = module.TabID,
                        RuleType = UrlRuleType.Module,
                        Parameters = "PID=" + portfolio.PortfolioID.ToString(),
                        Action = UrlRuleAction.Rewrite,
                        Url = CleanupUrl(portfolio.MappedUrl.Equals("") ? portfolio.Title : portfolio.MappedUrl),
                        RemoveTab = !includePageName
                    };
                    Rules.Add(rule);
                }
            }

            return Rules;
        }

    }
}
Coordinator
Jan 3, 2014 at 3:05 PM
Hi,

For 1)

It's a "bug" corrected in next version.

The default document in IIS contain uppercases.

I have change default document in your web.config
        <defaultDocument>
            <files>
                <clear />
                <add value="default.aspx" />
            </files>
        </defaultDocument>

Now it works ok.
Regards,
Sacha
Coordinator
Jan 3, 2014 at 3:12 PM
Hi,

For 2)

It was not enabled in the OpenUrlRewriter Admin module.

Now it's works ok.

Regards,
Sacha
Jan 3, 2014 at 3:13 PM
Hi Sacha,

Thanks a lot...

Regards,
Geo