Passing variables through permalink structure

Solved it! // Register the variables that will be used as parameters on the url function add_my_var($public_query_vars) { $public_query_vars[] = ‘extra_slug’; return $public_query_vars; } add_filter(‘query_vars’, ‘add_my_var’); // Build the rewrite rules, for the extra parameter function do_rewrite() { add_rewrite_rule(‘(accommodation)/[/]?([^/]*)$’, ‘index.php?pagename=accommodation&extra_slug=$matches[2]’,’top’); } add_action(‘init’, ‘do_rewrite’); // The parameter is now accessible get_query_var(‘extra_slug’)

Securing wp-admin folder – Purpose? Importance?

But if you protect wp-login.php, how would a hacker even get into the dashboard anyways? An attacker could try to hijack or forge a valid authentication cookie. Recently there was a possibly vulnerability which made it »easier« to forge such a cookie: CVE-2014-0166 It was fixed with Version 3.7.3/3.8.3 How does “Code A” compare to … Read more

Htaccess for Wordpess set on single subdomain

My suggestion is: use the same standard .htaccess configuration for WordPress on a single domain in each WordPress directory. <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> Along with it, add a small CODE to make sure users are redirected to the … Read more

Allow admin login at /admin

another option – redirect /admin/ to wp-login.php with a parse_query action hook: function wpa53048_parse_query( $query ){ if( $query->query_vars[‘pagename’] == ‘admin’ ): wp_redirect( wp_login_url() ); exit; endif; } add_action( ‘parse_query’, ‘wpa53048_parse_query’ ); EDIT Well the above apparently only works with certain permalink structures. Here’s another method hooked to parse_request: function wpa53048_parse_request( $query ){ if( $query->request == … Read more

Permalink Issues by Installing WordPress in Subdirectory / Subfolder

What I generally do Install WP in sub directory. Open permalink set required permalink. Open settings->general link Remove the sub directory name from ‘Site Address (URL)’ Cut the index.php and .htaccess files from sub directory and paste them to root change code in index.php as you did. Again access settings->permalink save the form Done. You … Read more

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