Rewrite URL for single category
Rewrite URL for single category
Rewrite URL for single category
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
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
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
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
How to write Rewrite rule for same path using Rewrite API?
rewrite wordpress page url for seo friendly query strings
Take a look on Pretty links feature of wordpress: https://codex.wordpress.org/Using_Permalinks#Using_.22Pretty.22_permalinks This feature allow wordpress to rewrite the URL’s on the fly. But may need some modifications on the host .htaccess file.
At the end of the day, you’ll be putting stuff into your .htaccess file. But, could speed things up via the following method… You want to end up with two lists, taken from the wp_posts table. Both lists have the same fields/columns: Post ID; and Post URL. List 1 – created without the posts being … Read more
adding custom controller called by front-end