Quick Nav:  Online Store   |   Login | Register

Home URL

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.
AuthorMessages
Rodney
<100 Posts
Posts:85


06/05/2008 3:44 AM  

Hi John,

This should be an easy one - I want to use the simple rule of checking for the rather rubbish "http://www.pokerdiy.com/Home/tabid/354/Default.aspx"

and instead replacing it with just "default.aspx".

My rule is:

http://www.pokerdiy.com/Home/tabid/354/Default.aspx 

replace with

http://www.pokerdiy.com/

but this just does not seem to work - if I put http://www.pokerdiy.com/Home/tabid/354/Default.aspx into the browser it doesn't replace it. Is it possibly something to do with rule order?


thanks
Rodney Joyce
Smart-Thinker.com - DotNetNuke Modules for Social Networks
PokerDIY.com - Simple Poker Leagues
John Mitchell
Posts:3268


06/09/2008 8:50 AM  

Hi Rodney,

Sorry, this question slipped by me.  The replacements only replace content in the output of your page. A replacement can not be used to rewrite a Url that is put in the address bar of the browser.

You may only need the replacement, but if you want to remove that old Url from the search engin index then you need to do a 301 redirect rule.

 

Rodney
<100 Posts
Posts:85


06/09/2008 6:17 PM  

Oh, ok I see - thanks John. That would explain why the 301 rules replace the browser address as they are of course doing a redirect.


thanks
Rodney Joyce
Smart-Thinker.com - DotNetNuke Modules for Social Networks
PokerDIY.com - Simple Poker Leagues
Rodney
<100 Posts
Posts:85


06/29/2008 11:03 PM  

Hi John,

This is a related question but I can't seem to get this working:
Basically I have an old page (http://www.pokerdiy.com/Home/PokerAlerts/tabid/524/Default.aspx) which I want to redirect to http://www.pokerdiy.com/Home/PokerFeeds/tabid/524/Default.aspx (DNN throws a fit when you have the word "alert" in a page name!)

I have added a PB module to that tab (ID 524) and set up 2 rules for this - the first is a simple find and replace rule that will change any internal links on PokerDIY to the new URL and the second is a 301 rule that will update the search engines to the new locations.

For simplicity I have turned off the replacement rule. At the bottom of my Poker Feeds page there is a menu bar with the link "RSS Feeds" - this links to the old url of http://www.pokerdiy.com/Home/PokerAlerts/tabid/524/Default.aspx. I would expect my 301 rule below to do a redirect to the new URL, but it does not work for some reason:

[PB: IF (Match("[PB:Request.Url]","http://www.pokerdiy.com/Home/PokerAlerts/tabid/524/Default.aspx") ) {
[PB: Response.Status("301 Moved Permanently") ]
[PB: Response.AddHeader("Location","http://www.pokerdiy.com/Home/PokerFeeds/tabid/524/Default.aspx")]
[PB: Response.End() ]
} else{
}]

Note, I have put a "1" after the

What am I doing wrong?

 


thanks
Rodney Joyce
Smart-Thinker.com - DotNetNuke Modules for Social Networks
PokerDIY.com - Simple Poker Leagues
Rodney
<100 Posts
Posts:85


06/29/2008 11:04 PM  
ps - sorry to be a pain but this is quite urgent as I have changed many URLs and need to do this before they get indexed...

thanks
Rodney Joyce
Smart-Thinker.com - DotNetNuke Modules for Social Networks
PokerDIY.com - Simple Poker Leagues
John Mitchell
Posts:3268


06/30/2008 8:16 AM  

Hi Rodney,

For replacements of Urls in the output of your pages it is better to use a Portal Rule instead of a Page Rule so that all pages get the replacement instead of just the one that you have the module on.

For the 301 Redirect Rule, I can't see what you posted because the forum has gobbled up part of the post. 

I actually have a better way to do 301 redirects now which uses the ResourceLocationTable.config file.

I have attached a new DLL, and a sample ResourceLocationTable with a 301 Redirect in it if you want to give it a try.

If you already have some virtual Paths defined then they will be listed in your current ResourceLocationTable.config file, so you will want to just add a node like the one attached instead of replacing the whole file.

 

 


Attachment: 163016262371.zip

Rodney
<100 Posts
Posts:85


06/30/2008 5:46 PM  
Hi John,

301 Rule - ok, out of interest it was :

[PB: IF (Match("[PB:Request.Url]","http://www.pokerdiy.com/Home/PokerAlerts/tabid/524/Default.aspx") ) {
[PB: Response.Status("301 Moved Permanently") ]
[PB: Response.AddHeader("Location","http://www.pokerdiy.com/Home/PokerFeeds/tabid/524/Default.aspx")]
[PB: Response.End() ]
} else{
head 1
}]

(with the correct HTML for the else statement).

I am now looking at the Infinity URL Master product for the 301s as I want to change every single URL and it makes the 301 redirecting a lot easier (I have hundreds of tabs) so I'll see if I need this (just testing it on the test site). Will use PageBlaster for the output changing for this..

I was just thinking, a nice feature might be to log (in a report, as apposed to a log file) all the matches it finds on a rule. So say for example I want to change an old URL to a new one - I would prefer to make the changes in my actually pages where-ever I have linked to it from, so after a month I could grab this report for that particular rule and see exactly what tabs are referencing the old URL and go through them all...


thanks
Rodney Joyce
Smart-Thinker.com - DotNetNuke Modules for Social Networks
PokerDIY.com - Simple Poker Leagues
John Mitchell
Posts:3268


06/30/2008 5:52 PM  

Yes, I have been thinking of doing some logging/stats with reports.

It kind of goes against the main purpose of the module (performance), but I still think some useful reporting could be accomplished if someone were willing to "give back" some performance for that.

 

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



ActiveForums 3.7
Powered by: Snapsis Software