Creating a copy of a website in a subdirectory, wp-admin redirect problem

If it’s a standard WordPress .htaccess file that won’t be your problem. I’m willing to bet you forgot to change the Site URL values when you imported the database. You can either edit it in the options table in your database or even in your wp-config file by adding define(‘WP_HOME’, ‘http://mainwebsite.com/test’); define(‘WP_SITEURL’, ‘http://mainwebsite.com/test’); to it. … Read more

Prevent wordpress autoredirect

Not really a WP-specific question, but I’ll help you out. That regex will match ex.com/helloworld/ but not ex.com/helloworld. To handle both you’d want RewriteRule ^helloworld/?$ /careers/helloworld-recruiting/ [L,R=301] The question mark makes the preceding token optional and the single slash rather than double in the rewritten URL makes it relative to the root.

Password protect directory but not files

As far as I know, the few files that you are talking about are always going to be the same, that means you can add exceptions to your .htaccess and “let them go through the cracks”. With an example of code from what you wrote so far may help us direct you on how to … Read more

url rewrite .htaccess extension to permalink

This should work for you- function wpse28906_rewrites_init(){ add_rewrite_rule( ‘mypage/([^/]+)/?$’, ‘index.php?pagename=mypage&myslug=$matches[1]’, ‘top’ ); } add_action( ‘init’, ‘wpse28906_rewrites_init’ ); function wpse28906_query_vars( $query_vars ){ $query_vars[] = ‘myslug’; return $query_vars; } add_filter( ‘query_vars’, ‘wpse28906_query_vars’ ); You can then use get_query_var( ‘myslug’ ) in your template to get your slug value. Don’t forget to flush your rewrite rules after adding … Read more