I've been trying to find a solution for days now and I am absolutely stumped.
I am putting together a website to list my domain portfolio for sale and I'm using a plugin I purchased to lists the domains. The author of the plugin is nowhere to be found and I only have a basic understanding of PHP.
The plugin lists each domain name as an individual post, but it uses a custom post type which is displaying the post page url as optibrands.com/?mdlp_my_domain_list=znvr-com
where znvr.com
is the domain for sale and title of the post.
What I want to do is clean up the url by removing /?mdlp_my_domain_list=
and having it displayed as optibrands.com/znvr-com
or optibrands.com/domain/znvr-com
if the former isn't possible.
I tried rewriting the htaccess tons of different ways, but nothing has worked. The closest I've come is adding:
`RewriteEngine On RewriteCond %{THE_REQUEST} \ /+(index.php)?\?mdlp_my_domain_list=([^&\ ]+) RewriteRule ^ /%2? [L,R]
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]+)$ /?mdlp_my_domain_list=$1 [L,QSA]`
This rewrites the urls how I would like, but it creates a redirect loop error.
I have also tried tweaking the plugin's functions PHP, but I'm not quite sure I know what I need to be editing.
These are the pieces of code I think need to be rewritten:
public function filterRewriteRules( $wp_rewrite ) {
$base = trailingslashit( $this->rewriteSlug );
$baseSingle = trailingslashit( $this->rewriteSlugSingular );
$baseTax = trailingslashit( $this->taxRewriteSlug );
$baseTax = "(.*)" . $baseTax;
$newRules[$base . 'page/(\d+)'] = 'index.php?post_type=' . self::POSTTYPE;
$newRules[$baseTax . '([^/]+)/?$'] = 'index.php?post_type= ' . self::POSTTYPE;
$wp_rewrite->rules = $newRules + $wp_rewrite->rules;
and/or
public function initialize() {
$this->pluginName = __( 'My Domain List', $this->pluginDomain );
$this->rewriteSlugSingular = 'my-domain-list-pro-single';
$this->rewriteSlug = 'mdlp_my_domain_list';
$this->taxRewriteSlug = $this->rewriteSlug . '/' . __( 'mdlp_categories', $this->pluginDomain );
and/or
public function create_post_type() {
$this->get_post_type_labels();
register_post_type(self::POSTTYPE, $this->postTypeArgs);
register_taxonomy( self::TAXONOMY, self::POSTTYPE, array(
'hierarchical' => true,
'update_count_callback' => '',
'query_var'=>true,
'rewrite' => false,
//'rewrite' => array('slug'=> $this->taxRewriteSlug),
'public' => true,
'show_ui' => true,
'has_archive' => true,
'labels' => $this->taxonomyLabels
Edit: Here is the entire contents of the PHP file
If anyone has any idea what I can do to fix this I will be forever grateful, because I've just about given up hope!
rewrite
set to true and be done with it.