Filter URLs

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
The default URL when a filter(s) is applied in nopCommerce is something like:

http://demo.nopcommerce.com/c/4/notebooks?specs=5,7

This URL denoates that I have CPU Type: AMD and Memory: 1GB applied

However I need the URL to be (via IIS7 Rewrites or rewritten in nopCommerce) something like:

http://demo.nopcommerce.com/c/4/notebooks/amd/1gb

I need the URLs to be in a forced order, such as: http://demo.nopcommerce.com/c/4/notebooks/spectype1/spectype2

So for the above example, it would always be: http://demo.nopcommerce.com/c/4/notebooks/amd/1gb and never: http://demo.nopcommerce.com/c/4/notebooks/1gb/amd to eliminate duplicate content

I expect it would be a case of checking the URL and if any spec attribute values exist, rewrite them to pass the spec id.

Any ideas on how I could achieve this, I have URL rewrite installed on IIS7 but I think it much be something that needs doing in nopCommerce itself in order to check the spec values and rewrite....

Thanks in advance

Dave
12 years ago
inspired wrote:
The default URL when a filter(s) is applied in nopCommerce is something like:

http://demo.nopcommerce.com/c/4/notebooks?specs=5,7

This URL denoates that I have CPU Type: AMD and Memory: 1GB applied

However I need the URL to be (via IIS7 Rewrites or rewritten in nopCommerce) something like:

http://demo.nopcommerce.com/c/4/notebooks/amd/1gb

I need the URLs to be in a forced order, such as: http://demo.nopcommerce.com/c/4/notebooks/spectype1/spectype2

So for the above example, it would always be: http://demo.nopcommerce.com/c/4/notebooks/amd/1gb and never: http://demo.nopcommerce.com/c/4/notebooks/1gb/amd to eliminate duplicate content

I expect it would be a case of checking the URL and if any spec attribute values exist, rewrite them to pass the spec id.

Any ideas on how I could achieve this, I have URL rewrite installed on IIS7 but I think it much be something that needs doing in nopCommerce itself in order to check the spec values and rewrite....

Thanks in advance

Dave


You could use IIS rewriting, but I believe this is not an ideal solution and I've outlined why below.

1. The  Url rewriting extension is best suited for persisting legacy URLs that may have changed.
2. Programming these URL's into IIS rewriting will be a lot of work and a lot of maintenance.
3. These URL's will be painful to test and verify. For example if you add a new specification you will need to ensure all other routes are still working.

I think there are better technologies to accomplish this. If I was tasked with this functionality I would use MVC routing and some custom code to get the functionality you're requesting.

The benefits include easier testing and maintenance, less configuration, and deployment or environment cloning will probably be easier as well.

If you're uncomfortable with writing the code yourself I would contact a solution provider, because it will probably cost less than the amount of time you're going to spend building this functionality on your own with url rewriting.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.