Mobile app version of vmapp.org
Login or Join
Speyer207

: Use of no-index-meta-tag on pretty URLs? By now I am fighting through the world of SEO and run into a problem, I think. Let's say I have a page like www.example.com/i-am-a-pretty-url, which

@Speyer207

Posted in: #CleanUrls #GoogleIndex #Indexing #Noindex #UrlRewriting

By now I am fighting through the world of SEO and run into a problem, I think.

Let's say I have a page like example.com/i-am-a-pretty-url, which is re-written by .htaccess from i-am-ugly-url.php to the above version.

If I now want google to NOT index the pretty url, will it take an effect, if I add <meta name="robots" content="noindex" /> to the i-am-ugly-url.php file?

I think it should, because there is no other way to prevent the indexing of a re-written URL, right?

However I tried this method on some "not-to-index" URLs of mine to remove them from Google index and redirected them to a remove.php, which has the meta-tag no-index in it. I fetched the URLs as Google to crawl these pages quickly multiple times, but there was no effect for days.

If the crawler not consider the meta tag, then every rewritten URL will be indexed, if the crawler finds the page anywhere. If it does and I remove the no-index-tag from the resource file, both URLs - the pretty URL and the file (*.php) will be indexed, if mentioned anywhere.

So how I solve this dilemma?

UPDATE:

.htaccess sample:
RewriteEngine on
...
...
RewriteRule ^(.*)blog/$ artikel.php
...
...


thats what I want: example.com/blog/ -> indexed example.com/article.php -> not indexed

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Speyer207

1 Comments

Sorted by latest first Latest Oldest Best

 

@BetL925

There is a way to set headers when rewriting. This is based on this Stackoverflow response and I used it successfully for one of my customer.

An example of implementation would be to set an environement variable while rewriting :

RewriteRule PATTERN DESTINATION [ENV=NOINDEX:true]


And then treat all requests tagged with this environment variable (NOINDEX) to add the X-Robots-Tag header:

Header set X-Robots-Tag "noindex, follow" env=NOINDEX


You can read more information about this header that replaces the meta-tag on this Google page, but be aware that few search engines might not support it yet.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme