Generate SEO friendly URLs (slugs) [closed]

I like the php-slugs code at google code solution. But if you want a simpler one that works with UTF-8: function format_uri( $string, $separator=”-” ) { $accents_regex = ‘~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml);~i’; $special_cases = array( ‘&’ => ‘and’, “‘” => ”); $string = mb_strtolower( trim( $string ), ‘UTF-8’ ); $string = str_replace( array_keys($special_cases), array_values( $special_cases), $string ); $string … Read more

Block all bots/crawlers/spiders for a special directory with htaccess

You need to have mod_rewrite enabled. Placed it in .htaccess in that folder. If placed elsewhere (e.g. parent folder) then RewriteRule pattern need to be slightly modified to include that folder name). RewriteEngine On RewriteCond %{HTTP_USER_AGENT} (googlebot|bingbot|Baiduspider) [NC] RewriteRule .* – [R=403,L] I have entered only few bots — you add any other yourself (letter … Read more

Google search results site map?

Google calls them sitelinks. You can’t enforce them currently: We only show sitelinks for results when we think they’ll be useful to the user. If the structure of your site doesn’t allow our algorithms to find good sitelinks, or we don’t think that the sitelinks for your site are relevant for the user’s query, we … Read more

JSON-LD Schema.org: Multiple video/image page

If you have multiple items as value of a property, you could use an array: <script type=”application/ld+json”> { “@context”: “http://schema.org”, “@type”: “WebPage”, “video”: [ { “@type”: “VideoObject” }, { “@type”: “VideoObject” } ] } </script> If you have multiple items on the top-level (not as value of a property), you could use a (named) graph … Read more