How realize SEF pagination (Ditto) - MODx? - .htaccess

Is it possible realize SEF pagination on Ditto - MODx? How do it - in scripts / nginx configuration (or anyone know htaccess solution )
What means..
It's pages whith list of articles
/articles.php
/articles.php?start=10
....
So in result should be
/articles.php/start/10
or something like it
And realize correct redirect to SEF
I'm very grateful to you in advance.

If you're going to use Ditto, you won't be able to do this without modifying the snippet code to set up paging as you require.
However, I would argue that /articles.php/start/10 is no more search friendly than the original as both 'start' and '10' are in no way related to the content on those pages. Google and the other search engines are certainly capable of distinguishing between pages with different url parameters in this case, however if this remains an issue you might be better off exploring a different way to create your listings.
Have a look here for some useful insights:
http://googlewebmastercentral.blogspot.com/2011/09/pagination-with-relnext-and-relprev.html
http://www.seomoz.org/blog/pagination-best-practices-for-seo-user-experience

Related

Trying to create seo friendly url

I'm trying to create friendly url for my site but with no success :(( and i have two questions
The first is:
How to change the url from domain.com/page/something.php to domain.com/something
And the second is:
Will the changes make duplicate content and if how to fix the problem.
Thank you for your time,
Have a nice day
Check out the official URL Rewriting guide: http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
You'll be using the simplest use case, Canonical URLs. Assuming you have no other pages that you need to worry about, you can use a rule like this: (note: untested, your usage may vary)
RewriteRule ^/(.*)([^/]+)$ /$1$2.php
While that example might not exactly work for your use case, hopefully reading the guide and my example will help you get you on your way.

Htaccess to block access to specific Mediawiki page?

In Mediawiki, I'm trying to find a way to block access to some of our template pages. I don't want some of our competition viewing our complex code and stealing it for their wikis (which is common in the fandom I'm from unfortunately). So I was trying to use htaccess to accomplish this by redirecting people to the main wiki page when they try to view a specific template page. However, nothing is happening. Here's what I used:
Redirect /wiki/index.php?title=Template:Box /wiki/index.php
I'm not sure what I'm trying to do is possible, though, or if this is how htaccess is supposed to be used!
Thank you in advance!
In short words: don't do that!
Let me quote the relevant part of MediaWiki docs: MediaWiki is not designed to be a CMS, or to protect sensitive data. To the contrary, it was designed to be as open as possible. Thus it does not inherently support full featured, air-tight protection of private content.
There's no way MediaWiki guarantees partial read permissions: either people are able to see every page, or none of them. Otherwise, there will be loopholes to read your precious data. For example, TerryE's trick with rewrite rules adds absolutely no security: among a hundred of other ways, one can simply change Template:Box into Template_:_Box and the latter will be normalised internally into the former. MW sometimes HTTP-redirects to normalised titles, but that is very easy to overcome.
There are lots of ways of getting template content in MW, and MW has its own access control extensions, so I think that you are trying to cure a leaking sieve, but answering your Q directly:
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} \bTemplate:Box\b
RewriteRule wiki/index.php $0? [L]
This will remove the query parameters if the URI is for /wiki/index.php and the query string contains Template:Box.

CakePHP nice urls - how to prevent normal urls from working

I have a website that's written using CakePHP. I've added some rewrite rules in the .htacces file to change the default urls to different ones (instead of /controller1/action1/parameter I have /some-string-about-controller-and-action/parameter, for example).
The problem is that now both the normal url and the nice one are available, and google seems to be indexing both, which is a problem. I'd like to only keep the nice one, which is the proper way to handle this so that it affects the google results as little as possible?
I don't know why you don't want to use cakes own routing (if you are having trouble doing what you want, you can accomplish what you want with a custom route class), then make sure that you redirect all relevant URL's in your .htaccess file to the desired URL using a MOVED PERMANENTLY redirect.
This way google will index the target url instead of the one that is undesirable. You are right to take offense to this, double indexing is a great way to harm your SEO rankings.

Erase '#' from url

UPDATED
I didn't understand how to make this work so I hope you know because I didn't found more solutions:
I have implemented jquery cycle in wordpress with the window.location.hash to make an individual url from each slide (example here http://jquery.malsup.com/cycle/perma.html)
Now I have an indez with some selected photos of differents categories that works with hashes like localhost/prueba/#men/#work61, localhost/prueba/#women/#work15, etc...the trick is that I have also the category /men/ and the photo #work61 permanetly cause the index may change but not the photo in the category indeed. So what I need is change the url without reloading from /#men/ to /men/ and if they share a link they will always go to the right photo and section (did I explain it well ?)
I have been testing many ways to arrive, with history.js and even with the aisle Pushestate but I didn't found the right solution. Lately I have made this with htaccess and it's closely what I need
Options +FollowSymLinks
RewriteEngine On
RewriteBase /prueba/
RewriteRule ^([^/]+)/([^/]+)/$ $1/#$2 [NE,R]
This changes me from localhost/prueba/men/work61 to localhost/prueba/men/#work61 but if I tried to add a hash to the first folder (#men), an also only work if somebody put the link directly
Any idea? Thanks in advance
I think you need to understand the URI specification, section 3.5 https://www.rfc-editor.org/rfc/rfc3986#section-3.5. Essentially, in the context of a web browser displaying HTML documents, the URI fragment (after the #) refers to a subset of the resource (page).
Basically if you removed the # from your URL, you will not be referring to a different subset of the same resource, but another resource entirely. So another page will be requested.

Add .html when rewriting URL in htaccess?

I'm in the process of rewriting all the URLs on my site that end with .php and/or have dynamic URLs so that they're static and more search engine friendly.
I'm trying to decide if I should rewrite file names as simple strings of words, or if I should add .html to the end of everything. For example, is it better to have a URL like
www.example.com/view-profiles
or
www.example.com/view-profiles.html
???
Does anyone know if the search engines favor doing it one way or another? I've looked all over Stack Overflow (and several other resources) but can't find an answer to this specific question.
Thanks!
SEO optimized URLs should be according to this logic (listed in priority)
unique (1 URL == 1 ressource)
permanent (they do not change)
manageable (1 logic per site section, no complicated exceptions)
easily scaleable logic
short
with a targeted keyword phrase
based on this
www.example.com/view-profiles
would be the better choice.
said that:
google has something i call "dust crawling prevention" (see paper: "do not crawl in dust" from this google http://research.google.com/pubs/author6593.html) so if google discovers a URL it must decide if it is worth crawling that specific page.
as google gives URLs with an .html a "bonus" credit of trust "this is an HTML page i probably want to crawl it".
said that: if your site mostly consists out of HTML pages that have actual textual content , this "bonus" is not needed.
i personally only add the .html to HTML sitemap pages that consists only out of long lists and only if i have a few millions of it, as i have seen a slightly better crawlrate above these pages. for all other pages i strictly keep the Franzsche URL logic mentioned above.
br
franz, austria, vienna
p.s.: please see https://webmasters.stackexchange.com/ for not programming related SEO questions

Resources