friendly URL remap format in DNN - iis

we have a custom module on our DNN site that creates unique URLs for each entry from an underlying database. The URLs would look something like this:
something/afn/something_else
A snippet from a full URL:
tabid/66/afn/160529-David%20Lewis-000258-010-003-00001
Without a trailing /Default.aspx. The module would see the /afn/, process the something_else, and if valid, render the unique page accordingly.
We just upgraded to DNN 8.0.3, and this is no longer working, instead we are getting 404 errors from IIS. We discovered if we append /Default.aspx to the URL, it works as it's supposed to. Changing the module to put /Default.aspx when the page is generated is simple. However that leaves countless links on our page, and on the web, that no longer work.
After much research I found the Friendly URL Settings in DNN under Host -> Host Settings -> Advanced Settings. This appears to have a way to remap URLs. The trouble I'm having is formatting the remap correctly.
My question:
What can I enter in the Friendly URL Settings so that if a user clicks on a url formatted like this:
ourwebsite.org/something/afn/something_else
it changes it to:
ourwebsite.org/something/afn/something_else/Default.aspx
Thank you very much.
EDITED: to add real life example URL.

WIth current DNN this should not be the case as the Default.aspx at the end isn't needed. In your upgrade, depending on the prior version, you will want to validate the "Url Settings" for the portal to ensure that for some reason that you don't have extensions turned on. Otherwise, when you upgraded did you see any errors? What version did you upgrade from.
Based on the standard setup of DNN URL's, this should work as desired assuming that /something/afn is the URL to a particular page. Or that something is the page and afn is the querystring.
Example /something?afn=something_else
Whereby you are expecting to see a Request.QueryString["afn"] value for the something_else value.

Related

URL Rewrite IIS and search engine

I've configured my IIS (asp.net site) to use URL Rewrite.
In particular this is my rule (dynamic one): whatever url in format number/string will be redirected to a special aspx page.
SSo whatever url starts with mysite/id/Name is redirected to showprof.aspx?id=id&title=Name. This works perfectly.
My question is about search engines. I don't have any "fixed" page that contains links like mysite/id/Name that the spider can scan, so I'm trying to figure it out how search engines could index my dynamic pages. Should I create a sitemap.xml? if yes in wich way? or should I create a "hidden" page that contains every link to all my dynamic contents like mysite/id1/Name1 mysite/id2/Name2 and so on?
thank you
A starting point is definitely a Sitemap.xml, You could try for example the IIS SEO Toolkit and see if it is able to index any of your pages: http://www.iis.net/downloads/microsoft/search-engine-optimization-toolkit
It also has functionality to generate a sitemap.xml, although I'm guessing in your case you probably have some dynamic content, so a better approach would be to have a "handler" that generates it dynamically on demand (maybe cache it for performance reasons).
I would also recommend to have some pages that actually are accessible through normal links, for example maybe have in your home page of the site a link to a "site map" page (not sitemap.xml), where there you render a set of links that you want to index (at least the ones that are most important to you), and that will make them easy to discover.

Magento SEO URL's suddenly changed, can't reenable

I’m fairly new to the Magento platform but I have a decent amount of experience in web development on apache servers.
A few days ago I was asked to look into an issue that was first made aware of with failing filters.
I had a look at the google analytics data and it seems the SEO friendly URLs have all stopped displaying. The navigation URLs still use friendly words however on the page return the URL is redirected to a basic catalog URL.
http://www.camera-camera.com/cameras-and-accessories.html
instead now it goes to
https://www.camera-camera.com/index.php/catalog/category/view/id/9
I checked the admin config. The Web > SEO URL rewrites are set to YES
I toggled them to No saved and back to yes then saved. Tried clearing the catalog URL rewrite cache
Checked the htaccess file and it hasn’t been touched for months.
Emptied the core rewrite table and reindexed it.
So I’m outta ideas now, was hoping some of you more experienced users can have some input as to what else I can check.
I also found it strange that the URL is now ignoring postback parameters. If you look at their filters they are simply an a link to the same page with a post parameter. This gets striped and ignored now might be related?
A file restore was on the day it happened. Any files I should check it against?
Thanks for any help you can provide !
I just discovered that it was related to HTTPS. I didn't notice but seems the site keeps redirecting to HTTPS even though the filter links etc are pointing to HTTP, in the redirect the parameters are dropped. Now to figure out why its going into HTTPS

Can .htaccess be configured to retain the same address on different pages?

Im configuring a desktop and mobile version of my site and was looking to use js to test for browser dimensions and then load the relevant version, however the problem is if someone shares a link from the mobile version and sends it to a desktop user then they circumvented the check. Is there a way to configure .htaccess (or some other method) to have the address bar show 'mysite.com' even though i would be loading 'mysite.com/mobile.htm'? I know i can always use media queries but that has the downfall of loading unused assets, so this method would be alot better.
Use a rewrite instead of a redirect. With a redirect, the browser is instructed to go to another address. With a URL rewrite, the server just responds with the contents of a different URL.
For just this page it will be simple, but it could be complicated, based on your site.
Another way is to include a little JS in every page to make sure you are on the right one for the device and redirect to the other if not. It would help if there was some pattern to easily determine the corresponding page.

Drupal url alias and views and clear urls for taxonomy issues

I am using views module. I have created blocks using views and a url using page display. This is for taxonomy. So my views url looks like this "news/science" So if someone click on the link he should be taken to www.example.com/news/science. However i am taken to a unstyled page with broken links. But when i try to use the url www.example.com?q=news/science i am taken to a proper page with correct data.
The issue is only with taxonomy related terms.
i.e all urls www.example.com/news/technology , www.example.com/news/sports appear broken and unstyled however if i manually visit www.example.com?q=news/technology and www.example.com?q=news/sports i am taken to a proper page.
Can anyone suggest what could be the reason.
The same issues is with admin login and logout. If i use www.example.com?q=user and try to login i can login. Also if i use www.example.com?q=logout i can logout. But if i use clean url aliases ie. www.example.com/logout then i am taken to access denied page.
Do you have the Path module enabled? Thats the module responsible for mapping ?q=logout to /logout.
See here: http://drupal.org/handbook/modules/path
Have you changed anything in .htaccess? any mod-rewrite changes that might be skipping over those particular urls?

Some SharePoint pages serve as http in https environment

I have a WSS 3.0 system using SSL where every page is supposed to be served as https. Almost all pages do come out as https, but in certain cases I click on a link and that brings up an http version of a page (which does not load). In those cases I have to put the 's' in by hand to get the page to load. Places where this happens are:
/_layouts/newgrp.aspx : when I try to create a new group, it takes me to http://server/_layouts/newgroup.aspx, although it should be https. The page does not load at http. It does load if I change the url by hand.
/_layouts/edtgrp.aspx : same thing as newgrp.aspx
if I go into a document library and view version history for a file, the URLs to the individual versions of that file are http. Interestingly, the browser status bar also indicates http when I hover over them (so it seems that SharePoint gets confused when it generates the links, rather than when I click on them)
To fix this, I have tried adding some javascript to the DOM that searches for instances of http and replaces them with https. This works in some cases, but there are some places where javascript can't reach, for example when SharePoint provides the target URL in response to a POST request, which I think is the case with newgrp/edtgrp.aspx.
I have also tried adding ISAPI filters to redirect pages from http to https. This seems to cause redirect loops, and in any case I'm not sure if such filters would preserve querystring or POST information.
Has anyone seen this problem?
Update: We have switched to ISA from Squid, and the problem continues in the version history, but not on new group or edit group. We have not seen any improvement yet from changing AAM settings.
Places where this is happening in ISA:
"Version History" under item in list or document library
"Manage Permissions" under item in list or document library
"Alert Me" under item in list or document library
"Add Users" menuitem in "People and Groups" page
"Group Settings" menuitem in "People and Groups" page
"Edit Group Quick Launch" menuitem in "People and Groups" page
"Set Up Groups" menuitem in "People and Groups" page
"List Settings" menuitem in "People and Groups" page
Not sure if this is it, but have you checked your alternate access mappings to make sure they say https instead of http?
I would echo the suggestion to check your Alternate Access Mappings. Is the SSL being done on the SharePoint Front Ends, or is it being done via a piece of dedicated SSL hardware?
Use an HTTP Module to modify SharePoint's output so that links are always changed to https. Such a module can plug into IIS and modify the HTML of anything rendered. I've used this technique to make SharePoint XHTML compliant and it works well.
Even better, almost all of the work has already been done for you. The UrlRewritingNet module is open source and available for free download. It should work fine for your SharePoint site. This tool has great documentation and uses regular expressions to match which URLs to alter. It should be pretty easy to write one for your case, e.g. ^http://. There's also many more advanced options you can take advantage of if necessary.
If you'd prefer to write your own then there is a good article called Rewrite.NET -- A URL Rewriting Engine for .NET on the 15 Seconds site.
Finally, if you're using IIS 7 you could try its URL Rewrite Module. I've never used this myself and don't know if it works with SharePoint, but it's the most UI-driven solution available.
Add a redirect in IIS from http to https. Every time you access that page it will redirect you to your https page instead.
I would also suggest placing WSS on another server to see if you have the same problems. If you don't, you might need to rebuild/migrate your stuff over.
Alex answered this question with an approach that I think will generally work. Here is how I fixed this specifically.
It looks like when a SharePoint aspx page is loaded, it populates a javascript structure of type ContextInfo (defined in init.js), which is instantiated in the variable ctx. That structure has a member called httpRoot, which is later used in core.js to build menuitems in various dropdown.
This ctx.httpRoot is for some reason populated in javascript in the aspx files created by SharePoint with a line like this:
ctx.HttpRoot = "http:\u002f\u002fsubdomain.domain.com";
Yes, it has Unicode slashes and it has http instead of https. I have no idea why. But, fixing this line of javascript seems to fix the problem.
I changed the line by adding a URL translation rule in ISA that converts http:\u002f\u002f\ to https:\u002f\u002f\ . I suspect that an HTTP module that makes the same replacement would also work. Or possibly some well placed javascript that reassigns the variable at some point.
I still believe this is not ideal and there must be a more appropriate way to fix these links.

Resources