Quick Nav:  Online Store   |   Login | Register

Replacement / Virtual Path / Friendly URL --> correct use of it

Rate this topic:

Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
Page 2 of 2<< < 12
AuthorMessages
Déclic Vidéo
<100 Posts
Posts:57


05/10/2007 9:21 AM  
Posted By John Mitchell on 05/10/2007 9:11 AM

If you don't want to define seperate virtual-paths for each language, then you can switch the UrlRewriter so that PageBlaster sees the language as a querystring variable. Put UrlRewriter after PageBlaster in the HttpModules list.

Then your virtual-path will be: Home.aspx

And for different languages you will have to specify it on the Url:

Home.aspx?language=en-Us

Seems like I have written something like this recently ;)

 

 



Sorry John. I do not understand.... What do you mean by : "for different languages you will have to specify it on the URL" ????
I would like ONE url for the page (otherwise, it is not SEO): Home.aspx which goes to EN or FR, depending of what people click as a flag. I have a flag on my home page, once you have chosen the language, I would like the Home.aspx to stay the same (as well as for other pages).
I am annoying, but I would like to understand how it works, and what I have to do, to achieve the goal I would like...
For the moment, I have found a trick, but this trick takes too much CPU and is not ok for my provider... :-(
 ==> I have to find a solution. I am opened to every solution (HrefExchanger or whatever or manually setting each page).
Untill now, I am still lost, do not know what to do....

 

DV

Déclic Vidéo
<100 Posts
Posts:57


05/10/2007 10:39 AM  

I have made some test. That's very clear (difference between replacement and Virtual Path) !!
Replacement are mandatory (otherwise, I have some links at the bottom of my page, and they are not re-writed....).
==> I will either use Replacement or Url Rewriter or the Friendly URL of DNN (which may achieve the same, if I setup one by one)

Now, I have to clarify the language thing... I am making some tests, it will be clearer soon and I will post a summary of what I understood. It may help others.

John, I just sent you an email with creditential, because I have a little problem with the Replacement... :-(


DV

John Mitchell
Posts:3084


05/10/2007 12:36 PM  

Ok, I recieved your e-mail, and I went to your site and created an all in one replacement rule that does what you want I think.

 It takes the page name from the first part of the Url, and switches it with Default.aspx

 So http://declic-video-fx.com.ultima4.net/Contact/tabid/68/Default.aspx

Becomes: http://declic-video-fx.com.ultima4.net/tabid/68/Contact.aspx

 The cool part about this is that you do not have to have a virtual path.

The reason for that is because the default Friendly Url provider handles any Url that has a tabid in it correctly.

 So, this one replacement rule, actually does what HRefExchanger does without the limitation of having unique page names since the tabid is also on the Url.

Here is the replacement rule for anyone else that wants to do this:

SearchFor:       (http[s]?://[^/]+/)([^/]+)/(?=tabid)([^"]+?)/Default\.aspx
ReplaceWith:    $1$3/$2.aspx

John Mitchell
Posts:3084


05/10/2007 1:33 PM  

After a little more tweaking, here is an improved rule.
This one grabs everthing up to the /tabid and moves it to the end, so that parent/child pages are handled better.

SearchFor:       (http[s]?://[^/]+)(/[^"]+)(/(?=tabid)[^"]+)/Default\.aspx(?!\?)

ReplaceWith:    $1$3$2.aspx

The rule now makes this:
http://declic-video-fx.com.ultima4.net/Hollywood_FX/Free_HFX/tabid/56/Default.aspx

Become this:
http://declic-video-fx.com.ultima4.net/tabid/56/Hollywood_FX/Free_HFX.aspx

Déclic Vidéo
<100 Posts
Posts:57


05/11/2007 7:54 AM  

Ok John, CONGRATULATION, sounds good.
One additionnal effort, and we are done !

1/
When clicking on the flag, there is some strange behavior:
http://declic-video-fx.com.ultima4.net/Hollywood_FX/Free_HFX/tabid/56/language/en-US/Default.aspx?Hollywood_FX=Free_HFX.aspx
Is it possible to get ride of the first "Hollywood_FX/Free_HFX" ?? Or not ?...

2/
With the 2 locales, I have 3 URL to reach my page:
http://declic-video-fx.com.ultima4.net/Hollywood_FX/Free_HFX/tabid/56/language/en-US/Default.aspx?Hollywood_FX=Free_HFX.aspx
http://declic-video-fx.com.ultima4.net/Hollywood_FX/Free_HFX/tabid/56/language/fr-FR/Default.aspx?Hollywood_FX=Free_HFX.aspx
http://declic-video-fx.com.ultima4.net/tabid/56/Hollywood_FX/Free_HFX.aspx
Not so good for SEO... Is there any possibility to have only the last one: http://declic-video-fx.com.ultima4.net/tabid/56/Hollywood_FX/Free_HFX.aspx ??

3/ Edited...
Sic... One big problem... I still have problems with hyphen. I have renamed the page Pinnacle_Studio to Pinnacle-Studio
And the replacement ignore the "-"... ==> PinnacleStudio.aspx
(The "_" was there for a 'trick", because I was using a trick to transform "_" into "-")

DV

John Mitchell
Posts:3084


05/11/2007 8:19 AM  

Those Urls with different languages are different pages.  You should want the Search engine to index them separately.

I can't do anything about the one with no language. If that is your default language then I would suggest having the flag not put a language variable on the querystring for that.  Actually, I guess we could fix it with PageBlaster by just removing everywhere that has language/en-US since that is the default.

The Urls you are showing I have not seen.  I'll have to take another look around.

I also see no reason why the Friendly Url rewriter has to remove dashes in your page names. I would consider that a bug.

Déclic Vidéo
<100 Posts
Posts:57


05/11/2007 10:37 AM  
Hello John,

I have done plenty of test this afternoon. Here are my conclusions/questions:

- with Inventua HRef exchanger, it is problematic for parent/child pages.
Example: Keyword1-Keyword2/Key3-Key4 are rewritten as: key3-key4.aspx
(and I would like Keyword1-Keyword2/Key3-Key4.aspx)
I have asked Inventua if this is possible:
http://www.inventua.com/forums.content?forumid=1&postid=3454&view=topic

- With your method, it is just perfect (parent/child are handled correctly)

- But with your method, I have problem as soon as I put an hyphen in the name of the page, the hyphen disappear....
:-(((
Can you have a look on my site (it appears like HollywoodFX without the hyphen) ???
[the underscore "_" is handled correctly, the "-" hyphen is not handled correctly. Maybe we can solve this in the regex ?]

- For the language, you are right, I would like both language to be indexed.
With your solution, there is a problem with parent/child page as soon as you click on the flag, there is extra information:
http://domainename.com/Keyword1-Keyword2/Key3-Key4/tabid/56/language/en-US/Default.aspx?Keyword1Keyword2=Key3_Key4.aspx


FINAL CONCLUSION:
- Either I can solve the problem of parent/child with HREF Exchanger
- Or we modify the regex you have found to correctly handle HYPHEN and language.

Up to you to have your advice... ;-)
THANKS A LOT FOR THE CONTINUOUS support you provide, but I think that each time, we go a step forward, and we learn a lot.

DV FX
PS: Concerning Ventrian Friendly URLs, unfortunately, it is not a bug but designed like this....
See http://www.ventrian.com/Support/ProductForums/tabid/118/forumid/35/postid/10301/view/topic/Default.aspx
John Mitchell
Posts:3084


05/15/2007 10:14 AM  
Hi DV,
I think I just figured out the reason that your dashes are being removed from your page names.
If you look in your web.config at the UrlRewriter config there is an item that look like this:
regexMatch="[^a-zA-Z0-9 _-]"

That charecter class has your dash in it, but because it is defined this way it also needs to be escaped with a \ (slash) in front.

Change it to this:
regexMatch="[^a-zA-Z0-9 _\-]"
Déclic Vidéo
<100 Posts
Posts:57


05/15/2007 11:44 AM  
Good idea, I will do so as soon as I am back from holidays !!!
But I have already asked Ventrian and he said that he was using the tab path (core system, which remove hyphen....)
Nevertheless, I will try it !!


DV
Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
Page 2 of 2<< < 12

Forums >Snapsis Product Support >PageBlaster > Replacement / Virtual Path / Friendly URL --> correct use of it



ActiveForums 3.7
Powered by: Snapsis Software