Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Issue with Remove slug post type error plugin WordPress

  • SOLVED

Hello I have the plugin "Remove Slug Custom post type error" that removes the 'portfolio-view' from myurl.com/portfolo-view/postname

When I activate it it causes this error:

Remove Slug Custom post type error!
.htaccess is not writable, please add following lines to complete your installation:
RewriteRule ^/(.+)$ /$1 [R=301,L]
RewriteRule ^/(.+)$ /$1 [R=301,L]
RewriteRule ^slide-view/(.+)$ /$1 [R=301,L]
RewriteRule ^portfolio-view/(.+)$ /$1 [R=301,L]
RewriteRule ^/(.+)$ /$1 [R=301,L]

I have had 3 different people look at it but can't seem to fix it. The issue is that the existing links change correctly to myurl.com/postname but new portfolio posts I create 404 and can only be reached by going to myurl.com/porfolio-view/postname. But the existing posts are working corrrectly at myurl.com/postname.

This is a problem I have been working on for days and no-one seems to be able to figure out why it 404's new listings.

Another strange thing is that the htaccess file does in fact contain the code that the plugin is saying is the issue, in fact that is all the plugin is actually doing is adding this line of code:

The htaccess file:

# BEGIN REMOVE SLUG CUSTOM POST TYPE RULES
RewriteRule ^safecss/(.+)/$ /$1 [R=301,L]
RewriteRule ^/(.+)/$ /$1 [R=301,L]
RewriteRule ^slide/(.+)/$ /$1 [R=301,L]
RewriteRule ^portfolio/(.+)/$ /$1 [R=301,L]
RewriteRule ^/(.+)/$ /$1 [R=301,L]
# END REMOVE SLUG CUSTOM POST TYPE RULES

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress



I have put the entire suggested code in the htaccess and have the same issue.

Answers (6)

2012-09-09

Manoj Raj answers:

can you paste the code used to generate your "custom post types" here?


liv comments:

<div id="content" class="grid_18">



<div id="gallery">

<ul class="portfolio">
<?php query_posts($query_string . '&orderby=rand') ?>
<?php

$i=1;

if ( get_query_var('paged') ) {

$paged = get_query_var('paged');

} elseif ( get_query_var('page') ) {

$paged = get_query_var('page');

} else {

$paged = 1;

}

query_posts( array( 'post_type' => 'portfolio', 'posts_per_page' => 12, 'paged' => $paged ) );

if ( have_posts() ) : $count = 0; while ( have_posts() ) : the_post(); $count++;

if(($i%3) == 0){ $addclass = "nomargin"; }

?>

<?php


$content = get_the_content();

preg_match("#liveembed/([^?\"]+)#is", $content, $owned);

preg_match("/channel=([^\"]+)/is", $content,$twitch);

$isLive = 0;

if(isset($owned[1]) && $owned[1]!=""){
echo "own3d";
$xml = simplexml_load_file("http://api.own3d.tv/liveCheck.php?live_id=".$owned[1]);
$live = $xml->liveEvent->isLive;
if($live == "true")
$isLive=1;

}else if(isset($twitch[1]) && $twitch[1]!=""){
$file = file_get_contents("http://api.justin.tv/api/stream/list.json?channel=".$twitch[1]);
$pos = strpos($file,"name");
if($pos!==false)
$isLive=1;
}


?>



<?php if($isLive): ?>
<li class="<?php echo $addclass; ?>">

<div class="folio-desc">
<div class="folio-desc-inner">

<h4><a href="<?php the_permalink(); ?>"><?php $title = the_title('','',FALSE); echo substr($title, 0, 40); ?></a></h4>

<time datetime="<?php the_time('Y-m-d\TH:i'); ?>"><?php the_time('m.d.Y'); ?></time>

</div></div>

<span class="image-border"><a class="image-wrap" href="<?php the_permalink() ?>" title="<?php _e('Permanent Link to', 'theme1418');?> <?php the_title_attribute(); ?>" ><?php the_post_thumbnail( 'portfolio-post-thumbnail' ); ?></a></span>

</li>
<?php endif;?>


liv comments:

any idea?


Manoj Raj comments:

Can you send me admin details through a personal Message? I will fix it... I sent you a PM already...


liv comments:

I sent you information.


Manoj Raj comments:

Got it.. Thank you.. Will have a look into it and let you know...

2012-09-07

Michael Caputo answers:

Have you updated your permalinks in Settings > Permalinks?


liv comments:

yes

2012-09-07

Romel Apuya answers:

.htaccess is not writable, please add following lines to complete your installation:

well your htaccess file might not have the right file permission.
i guess its 644.


liv comments:

Didn't work.

2012-09-07

Hardeep Singh answers:


I see difference in the .htaccess that is on top (in the error) and actual .htaccess printer below.

Please change:

RewriteRule ^portfolio/(.+)/$ /$1 [R=301,L]

to

RewriteRule ^portfolio-view/(.+)/$ /$1 [R=301,L]

And let me know the status now.


liv comments:

still 404s.


Hardeep Singh comments:

Please share a screen shot of edit post for a portfolio item.
One for new and one for existing.

I want to see the permalinks generated.


liv comments:

New post that 404s.