Developer forum

Forum » CMS - Standard features » Avoid Default.aspx URLs

Avoid Default.aspx URLs

Tomas Gomez
Reply

Hi,

We want to avoid the Default.aspx URLs in frontend, in order to avoid the 301 and 303 jumps from Default.aspx to the friendly URL.

We already use getFriendlyURL() in the templates. However, we use the rewritemaps.config file to link the "Default.aspx?GROUPID=XXX" to their correspoding friendly urls.

Does using System>Web and HTTP>Redirects avoid these jumps?
Is there any trick to avoid them?

Regards,
Tomas


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

I am not sure what you are trying to achieve. Friendly URLs are dealt with automatically, What do you have under Settings | Web and HTTP | Customized URLs? There you can configure the rules for pages, ecommerce content and more.

Imar

 

 
Tomas Gomez
Reply

Thanks Imar for the response.

We don't have any of those aliases configured in the Customized URLs. They are in the rewritemaps.config file of the server.

We have a page that acts as a landing page for certain PIM groups. The URL of these landings must have a special format (eg. "/list-mongoose-bikes"), so we link the special name of each group to a different "Default.aspx?GROUPID=XXX" URL in the rewritemaps.config. As a result, there are 301 and 303 jumps in the frontend from Default.aspx to the friendly URL

As for your suggestion, does the Customized URLs settings avoid these jumps?

Which is the best place to configure these aliases in order to avoid the 301 and 302 jumps? As far as we know, we can configure them in Settings > HTTP > Customized URLs, in Settings > HTTP > Redirects, in rewritemaps.config file, or in Web.config file.

Regards,
Tomas

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

>> As for your suggestion, does the Customized URLs settings avoid these jumps?

Most likely yes, but it depends on where you use it.

With friendly URLs turned on, outbound links are automatically changed. So if you have a template that outputs something like /Default.aspx?ID10&GROUPID=GROUP12, the resulting HTML will contain a link like /Products/Bikes. Then when the browser visits /Products/Bikes, it will be translated back internally to /Default.aspx?ID10&GROUPID=GROUP12 which means no 30X redirect is happening.

>> As far as we know, we can configure them in Settings > HTTP > Customized URLs, in Settings > HTTP > Redirects, in rewritemaps.config file, or in Web.config file.

These are somewhat different things:

1. Settings > HTTP > Customized URLs

These are for built-in friendly URLs. It creates URLs like /products/bikes automatically. This should be the first area to look into to get your link structure correct.

2. Settings > HTTP > Redirects

This is for additional redirects, and covers uses case like:

- Migration of an old site to Dynamicweb. For example, this allows you to map a URL on your old site /index.php?Prod=123 to something like /products/mongoose
- Marketing URLs where you have a short URL like /win that maps to a deeper URL like /customers/actions//2021/winter/participate

3. in rewritemaps.config file

This uses IIS URL rewrite to convert /something-old to /something-new. This happens at the server level, even before Dynamicweb kicks in and it allows you to define how it should behave (redirect or rewrite). It's similar to #2 above but then at the server level. It's good for managing URLs in bulk, but less visible for content managers as it happens in server config files.

4. in Web.config file - same as in web.confg but less obvious and could lead to data loss when the file is overwritten with a new one.

So, in summary, start with 1 and optimize your URLs. Then look at #2 or #3 for inbound URLs you want to redirect. If you use #2, you can specify the pretty (final) URL as the destination so you can map the external URL /list-mongoose-bikes to whatever pretty URL you need like /products/list/mongoose instead of ID=123&GROUIPID=456

Hope this helps but let me know if it doesn't.

Imar

 
Tomas Gomez
Reply

Thanks for the detailed explanation!

Following your advice to do it by Customized, we found that ProductPage URLs are not working as expected.

The configuration of our Customized URLs is in the attached image "Customized URLs". At the end of that module, we don't have any alias in the "Custom mappings" field.

As well, the navigation of the Product page (ID=2399) is configured as in image "ProductPage".

However, in the server log there are calls to the products by non-friendly URLs as seen in the image "Server log"​

So why these non-friendly URLs appear in frontend? Can we avoid them?

Regards,
Tomas

 

 

 

Customized_URLs.PNG ProductPage.PNG Server_log.PNG
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

This is expected. The server logs are *not* the frontend but deep in the backend when the request is being handled. When a virtual request for something like /products/bikes comes in, Dynamicweb will rewrite it (without changing the URL for the user) to a physical handler like Default.aspx?ID=123&GroupID=456. So, the page that handles the request is still Default.aspx and it uses ID 123 and GroupID 456 to figure out what to do. All of this is transparent to the user and they would only ever see /products/bikes. But from an IIS perspective, it’s the page handler Default.aspx that does that work so that‘s what you will see in the logs.

Hope this helps,

Imar

 

 
Tomas Gomez
Reply

Hi Imar,

Dynamicweb internally rewrites the URLs and it is transparent to the user. The user never sees the non-friendly URLs. This is ok.

The problem is that, according the log of googlebot for SEO, googlebot is finding the URLs with Default.aspx format, and it takes too much time to crawl those URLs. This way, it has no time to crawl the friendly URLs. Firstly, it finds thousands of pages with the Deafult format so it has no time to find the friendly URLs.

Regards,
Tomas

 

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

If you still have Default.aspx links on your site, this could be an issue, and one you need to resolve. But if you don't have them anymore now, Google just has the old URLs from before you turned on friendly URLs. Dynamicweb's redirect mechanism will eventually fix that as Google gets redirected consistently to the friendly URLs.

Or am I misunderstanding what you are saying?

Imar

 
Tomas Gomez
Reply

Hi Imar,

We are using friendly URLs since the start of this project. Six months have passed and googlebot doesn't find them.

The page code has no links to URLs with a DEfault.aspx format. Moreover, the log of the server (located at DW cloud) shows two types of entries:

Type 1) URLs that are rewritten by DW before they are sent to the actual execution.
Example:
Line 167: 2021-10-20 00:00:36 10.21.142.46
GET /Default.aspx ID=2399&productid=PROD3632&Feed=True&redirect=true 443 - 195.154.126.60
Mozilla/5.0+(compatible;+AhrefsSiteAudit/6.1;++http://ahrefs.com/robot/)
https://mydomain.com/nameofmyproduct 200 0 0 203

Type 2) URLs that are read and crawled by googlebot
Example:
Line 2004: 2021-10-20 00:19:28 10.21.142.46
GET /Default.aspx ID=2399&GroupID=GROUP502 443 - 66.249.66.203
Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) - 200 0 0 2390

All the googlebot entries are with that Dfault format instead of the friendly URL. This is a very serious problem because, if we have 4000 products, googlebot read first the 4000 non-friendly URLs and, after that it almost doesn't read the friendly URLs. As a result the pages are no indexed.

This is what we have to solve. We don't know if it is an issue of the server setting, DW settings or how to solve it. We hace this problem since six months ago.

Regards,
Tomas

 

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

If Google has the Default.aspx links, it means they were there, or are still there. In the former case, sending redirects will fix that over time. In the latter case, you need to figure our where they come from.

Do you have a URL for me to look at? You can send it to imar at spaanjaars dot com if you don't want to share it here.

Imar

 
Tomas Gomez
Reply

Thanks for your attention!

I send you a mail.

Regards,
Tomas

 

You must be logged in to post in the forum