Search url wp-rewrite after redirect?

Fatih, Use str_replace for Turkish chars issue. Change code like this; /* Plugin Name: Redirect Search Results Author: Abdussamad Plugin URI: http://wordpress.stackexchange.com/questions/70740/search-url-wp-rewrite-after-redirect */ class redirect_search_results { function __construct() { add_action( ‘init’, array( $this, ‘redirect’ ) ); } function redirect() { if( isset( $_GET[ ‘s’ ] ) ) { $turkish= array(“İ”,”ı”,”Ü”,”ü”,”Ö”,”ö”,”ğ”,”Ğ”,”ş”,”Ş”); $nturkish = array(“i”,”i”,”U”,”u”,”O”,”o”,”g”,”Ğ”,”s”,”S”); $quest = … Read more

Tricky URL rewrite with custom values in url

As I mentioned in your other question, you don’t want to be touching the .htaccess file, you need an internal rewrite. So, given the URL: http://mysite.com/image/wp_username/3digitnumber we need to add the following rule to handle it: // set up the rewrite rule function wpa73374_setup_rewrites(){ add_rewrite_rule( ‘image/([^/]+)/([0-9]+)/?$’, ‘index.php?pagename=custompage&iuser=$matches[1]&iname=$matches[2]’, ‘top’ ); } add_action( ‘init’, ‘wpa73374_setup_rewrites’ ); Note … Read more

Need to make a php file inside theme accessible via url

Ok here is a test working solution: <?php /* Plugin Name: wpse26719 Plugin URI: http://en.bainternet.info Description: Need to make a php file inside theme accessible via url Version: 1.0 Author: Bainternet Author URI: http://en.bainternet.info */ // Register a URL that will set this variable to true add_action(‘generate_rewrite_rules’, ‘wpse26719_rw’); function wpse26719_rw($wp_rewrite) { $newrules = array(); $new_rules[‘^adserver.js.php$’] … Read more

unexpected problem in url rewrite

first, you need to add your custom_gallery_id to query vars if you haven’t already: add_filter( ‘query_vars’, ‘wpse26388_query_vars’ ); function wpse26388_query_vars( $query_vars ){ $query_vars[] = ‘custom_gallery_id’; return $query_vars; } for your rewrite rule, you need to load a WordPress object– a page, a category, etc., and all internal rewrites must point to index.php. if topic, place, … Read more

Rewrite Rule for Post “Subpage”, with pagination

After more research on url-rewriting add-rewrite-rule and rewrite-rules I got introduced to Redirect Canonical Redirects incoming links to the proper URL based on the site url. Search engines consider www.somedomain.com and somedomain.com to be two different URLs when they both go to the same location. This SEO enhancement prevents penalty for duplicate content by redirecting … Read more

Dynamic URL, not a physical page within the database

add_rewrite_rule can help you sniff the request and let you handle it however you want. if( ! class_exists(‘PropertiesEndpoint’)): class PropertiesEndpoint { // WordPress hooks public function init() { add_filter(‘query_vars’, array($this, ‘add_query_vars’), 0); add_action(‘parse_request’, array($this, ‘sniff_requests’), 0); add_action(‘init’, array($this, ‘add_endpoint’), 0); } // Add public query vars public function add_query_vars($vars) { $vars[] = ‘__properties’; $vars[] = … Read more

add_rewrite_rule again

Here’s an example with template_redirect that loads your php script if the prm1 query var is set: // set up the rewrite add_action( ‘init’, ‘wpse36736_setup_rewrites’ ); function wpse36736_setup_rewrites(){ add_rewrite_rule( ‘snpv/([^/]+)’, ‘index.php?prm1=$matches[1]’, ‘top’ ); } // add query var add_filter(‘query_vars’, ‘wpse36736_query_vars’); function wpse36736_query_vars( $query_vars ){ $query_vars[] = ‘prm1’; return $query_vars; } // check the query var … Read more

WordPress Rewrite

assuming u is a custom query var, you have to first add it to the array of recognized query vars: function wpa_query_vars( $query_vars ){ $query_vars[] = ‘u’; return $query_vars; } add_filter(‘query_vars’, ‘wpa_query_vars’); Then add an internal rewrite rule that accepts anything appended to vendors and passes that as the u query var: function wpa_rewrite(){ add_rewrite_rule( … Read more

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