add_rewrite_rule with query variables

First of all, Your code does not work because rewrite rules need to be flushed ( function flush_rewrite_rules ), and they need to be flushed for every $id change. Generally this is very bad idea, for performance reasons. You should add rewrite rule only with post_type=product, as You want to pass “p” as $_GET parameter … Read more

Create Dynamic SEO Friendly URL for Virtual Page

One approach could be to create a rewrite rule that will catch the 3 variables and provide them as parameters that can be passed on to your job template. Assuming your template slug is “job”: function jobquery_rewrite_rule() { add_rewrite_rule( ‘^job/([^/]*)/([^/]*)/([^/]*)/?’, ‘index.php?pagename=job&state=$matches[1]&city=$matches[2]&job=$matches[3]’, ‘top’ ); } add_action( ‘init’, ‘jobquery_rewrite_rule’ ); After inserting this action into your theme, … Read more

URL Rewriting for PHP script on an image URL

Try the following at the top of the .htaccess file, before the existing WordPress directives: # Internally rewrite “/image.jpg” to “/randomizer.php” RewriteRule ^image\.jpg$ randomizer.php [L] This uses mod_rewrite to rewrite the URL. There is no need to repeat the RewriteEngine On directive (that occurs later in the file). Any request for /image.jpg (in the document … Read more

Wildcard forward all posts and pages with few exceptions

You could do something like the following at the top of your .htaccess file, before the WordPress front-controller: # Prevent rewritten requests (to the WP front-controller) from being redirected RewriteCond %{ENV:REDIRECT_STATUS} . RewriteRule ^ – [L] # Redirect everything from “example.com” to “example.dev” # Except for certain URLs that should stay at .com RewriteCond %{HTTP_HOST} … Read more

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