Drupal url alias and views and clear urls for taxonomy issues - drupal-6

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?

Related

friendly URL remap format in DNN

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.

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.

Custom URL in Codeigniter using htaccess

I am developing a site on Codeigniter 2.0.2 . Its a site where companies/users can signup and create their own profile page, have their own custom url(like http://facebook.com/demouser), have their own feedback system, display their services.
This said, I have been successful in display the profile page in the following format
http://mainwebsite.com/company/profile/samplecompany
This displays the home page for the company samplecompany , where company is the controller and profile is the method.
Now I have few questions,
I guess it is possible to create to have/get http://mainwebsite.com/samplecompany using htaccess and a default controller. If anybody can help with the htaccess rule , that would be awesome. I am already using htacess to remove index.php from CI but could not get this working.
There will be few other pages for the given user/company such as feedback, contact us, services etc. So the implementation links that come to my mind is of the form
`
http://mainwebsite.com/company/profile/samplecompany/feedback or
http://mainwebsite.com/samplecompany/feedback
http://mainwebsite.com/company/profile/samplecompany/services or
http://mainwebsite.com/samplecompany/services
http://mainwebsite.com/company/profile/samplecompany/contactus or
http://mainwebsite.com/samplecompany/contactus
wheresamplecompany` is the dynamic part
Is it possible to create site links in the format?
I understand using A record for a given domain, I can point a domain say, http://www.samplecompany.com to http://mainwebsite.com/company/profile/samplecompany so typing http://www.samplecompany.com he should be taken to http://mainwebsite.com/company/profile/samplecompany . If this is successfully implemented, will
http://www.samplecompany.com/feedback
http://www.samplecompany.com/services
http://www.samplecompany.com/contactus
work correctly?
I guess it is possible to create to have/get http://mainwebsite.com/samplecompany using htaccess and a default controller. If anybody can help with the htaccess rule , that would be awesome. I am already using htacess to remove index.php from CI but could not get this working.
There will be few other pages for the given user/company such as feedback, contact us, services etc. So the implementation links that come to my mind is of the form ` http://mainwebsite.com/company/profile/samplecompany/feedback or http://mainwebsite.com/samplecompany/feedback
You can accomplish this using routes. For example, in your /config/routes.php file, put this:
$route['samplecompany'] = "company/profile/samplecompany";
$route['samplecompany/(:any)'] = "company/profiles/samplecompany/$1";
The first rule tells CodeIgniter that when someone accesses http://mainwebsite.com/samplecompany that it should process it as if the URL were "company/profile/samplecompany". The second rule captures anything that comes in the URI string after "samplecompany" and appends it onto the end.
However, if you have multiple companies(not just samplecompany), you're probably going to want to extend CI's router to suppor this unless you want to manually edit the config file each time a new company is added.
OK, you're definitely going to want to handle dynamic company names(as per your comment). This is a little trickier. I can't give you the full code, but I can point you in the right direction.
You'll want to extend CI's router and on an incoming request query the DB for the list of company names. If the URI segment matches a company name, you'll want to serve it up using your company/profile method. If it does not, you will ignore it and let CI handle it normally. Check out this post on this topic for more information: forum link.
Here's a great guide on how to achieve what you need: Codeigniter Vanity URL's.

Static Main Page (login page) on Drupal Install

I am starting to create a site that uses Drupal. One of my requirements is that nobody will see any "real" content until they log in. The home page will basically be a static page with a logo, some basic "this is what the site does" copy, and then a login form. If you don't login, you can then only see some other static pages (faq, legal, privacy, etc...) but you can't use the actual site. Think Facebook's login page, basically just fluff with a login form.
From searching around, I have found 3 different methods for this:
Create a page that is basically separate from the Drupal installation, but then when the form submits, check it against the Drupal DB and then proceed if logged in successfully. This would be done with Apache, maybe an .htaccess file directive to change the first served page.
Use the Front Page extension. I haven't looked at this too extensively, has anyone used it? Pros/Cons?
Somehow finagle the default Druapl "Home Page" functionality to allow this to happen. I would rather not have to do this, unless someone knows that there is an easy way to do this.
One of my requirements is that nobody will see any "real" content until they log in.
There is a permission that users need have in order to access content on Drupal (access content); if anonymous users don't have that permission, then they would not be able to see any content.
Using the module you reported, you can create a different home page for anonymous users.
Solution #1 is not the ideal one as it requires more work for something that can be obtained from inside Drupal. Take in mind that the correct way to access Drupal DB is to use the DB API Drupal comes with.

postback url rewriting sharepoint

I am trying to do url rewriting in sharepoint . I have done something and its working fine but the problem is when I click on by default controls in sharepoint like edit page, approve or any links they are pointing to the old one and not to the new one and because of that I m getting 404 not found.
If anyone is having idea how to solve this in sharepoint .I have seen postback posts of Scott but in that he has mentioned postback with controls you create in asp.net add form browser but what abt existing ones in sharepoint. do I need to add something in the master page.
Any help would really be appreciated.
You could try overriding SharePoint's default postback handler (javascript function) using either an HttpModule, or by creating a control that replaces the old url for the new one, generating an postback function overide that uses that "translated" url. Then add the control to the masterpage.
Not too sure if this is possible. My guess is that you might run into some request validation issues when you do this.
EDIT:
Read scott guthrie article about this subject: article
How do you do your rewriting, e.g. what are your rules?
Mine does it in such a way the normal urls still work. Page editing is done through using the normal urls, so you don't get problems like this.

Resources