Answer the question
In order to leave comments, you need to log in
Problem in htaccess file, how to fix?
Good afternoon everyone.
I am preparing my blog for going online, trying to get rid of duplicate pages.
I write a command to the htaccess file, as per instructions I add after RewriteRule ^index\.php$ - [L]:
I
add:
RewriteCond %{QUERY_STRING} ^replytocom= [NC]
RewriteRule (.*) $1? [R=301,L]
RewriteRule (.+)/feed /$1 [R=301,L]
RewriteRule (.+)/attachment /$1 [R=301,L]
RewriteRule (.+)/comment-page /$1 [R=301,L]
RewriteRule (.+)/comments /$1 [R=301,L]
RewriteRule (.+)/trackback /$1 [R=301,L]
RewriteCond %{QUERY_STRING} ^attachment_id= [NC]
RewriteRule(.*) $1? [R=301,L]
I save the whole thing and close it.
After that, I add one code to the topic and that's it.
/* Inserts the noindex,nofollow robot meta tag for pagination */
function my_meta_noindex () {
if (
is_paged() //
) {echo "".''."\n";}
}
add_action('wp_head', 'my_meta_noindex ', 3); // add your noindex,nofollow to head
BUT after 5 minutes I look at the htaccess file and it's already empty, everything I added has disappeared!
I do everything through the file manager, I save everything.
What is the problem?
Just in case, maybe it's a bug?
instructions for which I did: pro-wordpress.ru/chast-2-raskrutka-bloga/kak-izbav...
Answer the question
In order to leave comments, you need to log in
What permissions do you have on .htaccess?
Try setting it to 600 to allow the owner to read and write, and deny everything else.
Don't put your instructions between the lines
# BEGIN WordPress
# END WordPress
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question