Clean URLs for custom $_GET variables

You should look at “Rewrite Endpoints”, which are much simpler to work with than custom rewrites. And they fit your use case perfectly: http://codex.wordpress.org/Rewrite_API/add_rewrite_endpoint You might add your “show” endpoint like so: function wpsx_37961_add_endpoints() { // Add the “show” rewrite endpoint to all URLs add_rewrite_endpoint(‘show’, EP_ALL); } add_action(‘init’,’wpsx_37961_add_endpoints’); Then you can check for its value … Read more

How to map permalinks with accented letters to sanitized slugs?

The best way to accomplish this is remove the default sanitize_title filter and replace it with yours, which will encode those characters properly. Here is an implementation of using accents in permalinks. Example: remove_filter( ‘sanitize_title’, ‘sanitize_title_with_dashes’); add_filter( ‘sanitize_title’, ‘restore_raw_title’, 9, 3 ); function sweURLtoCHAR($text) { $url=array( “%C3%81″,”%C3%A1”, “%C3%8D”,”%C3%AD” ); $char=array( “Á”,”á”, “Í”,”í” ); $str = … Read more

htaccess rewrite for author query string when WP is in subfolder

The question is about doing this with .htaccess, but why not disabling author pages from within WordPress instead? This would achieve the same result while making the subdirectory concern irrelevant altogether (and also works regardless of permalink structure settings) Sample code that sets all urls to author pages to a 404 error: add_action( ‘template_redirect’, function() … Read more

404 when fetching image from wp-content/uploads/

Problem solved. The plugin “User Access Manager” was found guilty of inserting a .htaccess file into wp-content/uploads/ and not handling calls properly afterwards. I don’t know how UAM plugin could be fixed, but It’s ok to remove the .htaccess file. Nothing else depends on it. (at least in my case)

mod_rewrite enabled but Permalinks show index.php

The output of $_SERVER[‘SERVER_SOFTWARE’] is WebServerX That looks like your problem – check out this line in wp-includes/vars.php: /** * Whether the server software is Apache or something else * @global bool $is_apache */ $is_apache = (strpos($_SERVER[‘SERVER_SOFTWARE’], ‘Apache’) !== false || strpos($_SERVER[‘SERVER_SOFTWARE’], ‘LiteSpeed’) !== false); I think you’ll need to override this variable manually, either … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)