Rewrite URL based on home_url

It looks like you want to redirect: http://example.com/18/profile to http://example.com/seller?page=profile If so, add the following to your .htaccess file in between the <IfModule mod_rewrite.c> tags that were created by WordPress: RewriteCond %{HTTP_HOST} RewriteRule ^18/profile/?$ seller?page=profile [R=301] Your .htaccess should looks like the following if it hasn’t been modified by another plugin: # BEGIN WordPress <IfModule … Read more

Redirecting /px/?q=x to /px/x/

In your .htaccess add the following rule in between the <IfModule mod_rewrite.c> tag: RewriteCond %{QUERY_STRING} ^q=(.*)$ [NC] RewriteRule ^/?px/(.*)$ px/%1? [L,R=301] Based off of the default .htaccess generated by WordPress, it should now look like the following with your custom RewriteRule: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond … Read more

How to create a front end user profile with a friendly permalink and a 404 trigger

I believe the solution here would be as simple as you’ve generally described it. Assuming conveniently that $wp_query->query_vars[‘user’] contains the username and not its ID: if ( array_key_exists( ‘user’, $wp_query->query_vars ) ) { if ( username_exists( $wp_query->query_vars[‘user’] ) ) { include( TEMPLATEPATH . ‘/user-profile.php’ ); } else { include( TEMPLATEPATH . ‘/404.php’ ); } exit; … Read more

How to achieve my custom post url structure?

I have created the custom URL using the function: add_rewrite_rule($regex, $redirect, $after). add_rewrite_rule( ‘^my-page/(.+)/?$’, ‘index.php?pagename=my-page&url=$matches[1]’, ‘top’ ); You can write your own custom rewrite rule and redirect to appropriate page: https://codex.wordpress.org/Rewrite_API/add_rewrite_rule