Is there any way of blocking my site to visitors that come from certain countries using the htaccess file? If possible, how should the line(s) of code look like?
Related
I am using the Wordpress plugin, Timely All-in-One events calendar. Unfortunately it is creating a plethora of duplicate URLs which end in strings like (https://www.mywebsite.com/events/action~agenda/page_offset~-2/request_format~json/cat_ids~4) or (https://www.mywebsite.com/events/action~oneday/exact_date~2-4-2019/) for example.
As a consequence of these URL directives each being for a different calendar view but containing the same webpage title and content, some search engines are seeing this as duplicate content. Whilst robots.txt is setup to tell bots to ignore the URLs containing said strings, some crawlers are ignoring robots.txt. I have also disabled the various different calendar views so there is now only the agenda view but even in spite of this, bots continue to crawl these URLs.
Therefore is it possible to use Apache/ a .htaccess directive to tell the server to direct any requests containing "/action~" to either remove the string from the URL so the browser just reads "/events/" or to redirect/forward the URLs to another page.
There are over 500 of these URLs so I ideally would like a quick remedy!
Thanks in advance.
Check this rewrite in your .htaccess file
RewriteEngine On
RewriteRule ^events\/action(.*)$ /events/ [L,R=301]
I need to redirect 500+ pages. The original url references the product id, now they want it to reference the product name. For example:
from:
www.thedomain.com/bn/products/product-details/72
to:
www.thedomain.com/bn/products/product-details/MR633
I know the rewrite rule needs to be:
RewriteRule ^/bn/products/product-detail/72$ http://www.thedomain.com/bn/products/product-detail/MR633 [R=301]
Will I need to create all 500+ redirect lines manually to add to the htaccess file, or is there a different, better approach? Google has indexed all 500+ pages, so they don't want to lose that juice. Any recommendations would be appreciated.
Also, is it OK/normal to have hundreds of redirects in an .htaccess file?
As a result of merging several sites together, I have a couple of thousand pages that need to be redirected. I cannot use wildcards as they are specific pages, so they will all be the form of:
Redirect 301 /old_page.html http://www.example.com/new_page.html
Is there a recommendation on how many lines can be in the .htaccess file before it starts to become a performance issue? I'm sure it depends somewhat on the apache configuration, system memory, etc. but I'm trying to get an estimate. Is 2,000 lines too long, or should it be 200, or is 20,000 okay?
I have a couple of thousand pages that need to be redirected. I cannot use wildcards as they are specific pages, so they will all be the form of:
Redirect 301 /old_page.html http://www.site.com/new_page.html
Nope, don't do that.
Redirect everything (expect maybe static ressources like js, css, images, ... that have not changed) for that no current content can be found to a script instead - and have that look up the new URL corresponding to the old one requested, and then does a redirect with a Location header.
Does anyone know if there is an .htaccess rule to redirect from somthing like this...
XXX/dodge/604-jeep-hard-start-cold
to...
XXX/dodge/jeep-hard-start-cold
Basically wondering if there is some sort a variable that will remove the number from URL's.
All URL's have different numbers, so it cant just be the 604 getting a redirect.
It is a Joomla site, and numbers refer to article #.
Thanks for any help !
Sounds like you need to configure Joomla to not add the article number to the url of the article. You can turn on Search Enging Friendly urls in the Global Configuration.
I'm in the process of rewriting all the URLs on my site that end with .php and/or have dynamic URLs so that they're static and more search engine friendly.
I'm trying to decide if I should rewrite file names as simple strings of words, or if I should add .html to the end of everything. For example, is it better to have a URL like
www.example.com/view-profiles
or
www.example.com/view-profiles.html
???
Does anyone know if the search engines favor doing it one way or another? I've looked all over Stack Overflow (and several other resources) but can't find an answer to this specific question.
Thanks!
SEO optimized URLs should be according to this logic (listed in priority)
unique (1 URL == 1 ressource)
permanent (they do not change)
manageable (1 logic per site section, no complicated exceptions)
easily scaleable logic
short
with a targeted keyword phrase
based on this
www.example.com/view-profiles
would be the better choice.
said that:
google has something i call "dust crawling prevention" (see paper: "do not crawl in dust" from this google http://research.google.com/pubs/author6593.html) so if google discovers a URL it must decide if it is worth crawling that specific page.
as google gives URLs with an .html a "bonus" credit of trust "this is an HTML page i probably want to crawl it".
said that: if your site mostly consists out of HTML pages that have actual textual content , this "bonus" is not needed.
i personally only add the .html to HTML sitemap pages that consists only out of long lists and only if i have a few millions of it, as i have seen a slightly better crawlrate above these pages. for all other pages i strictly keep the Franzsche URL logic mentioned above.
br
franz, austria, vienna
p.s.: please see https://webmasters.stackexchange.com/ for not programming related SEO questions