diff --git a/core/modules/comment/src/CommentForm.php b/core/modules/comment/src/CommentForm.php
index 98e9ddef96..d6b4174f7f 100644
--- a/core/modules/comment/src/CommentForm.php
+++ b/core/modules/comment/src/CommentForm.php
@@ -12,8 +12,10 @@
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Entity\EntityTypeBundleInfoInterface;
 use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Path\CurrentPathStack;
 use Drupal\Core\Render\RendererInterface;
 use Drupal\Core\Session\AccountInterface;
+use Drupal\Core\Url;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -46,7 +48,8 @@ public static function create(ContainerInterface $container) {
       $container->get('current_user'),
       $container->get('renderer'),
       $container->get('entity_type.bundle.info'),
-      $container->get('datetime.time')
+      $container->get('datetime.time'),
+      $container->get('path.current')
     );
   }
 
@@ -63,11 +66,14 @@ public static function create(ContainerInterface $container) {
    *   The entity type bundle service.
    * @param \Drupal\Component\Datetime\TimeInterface $time
    *   The time service.
+   * @param \Drupal\Core\Path\CurrentPathStack $current_path
+   *   Current path service.
    */
-  public function __construct(EntityManagerInterface $entity_manager, AccountInterface $current_user, RendererInterface $renderer, EntityTypeBundleInfoInterface $entity_type_bundle_info = NULL, TimeInterface $time = NULL) {
+  public function __construct(EntityManagerInterface $entity_manager, AccountInterface $current_user, RendererInterface $renderer, EntityTypeBundleInfoInterface $entity_type_bundle_info = NULL, TimeInterface $time = NULL, CurrentPathStack $current_path) {
     parent::__construct($entity_manager, $entity_type_bundle_info, $time);
     $this->currentUser = $current_user;
     $this->renderer = $renderer;
+    $this->currentPath = $current_path;
   }
 
   /**
@@ -105,7 +111,7 @@ public function form(array $form, FormStateInterface $form_state) {
 
     // If not replying to a comment, use our dedicated page callback for new
     // Comments on entities.
-    if (!$comment->id() && !$comment->hasParentComment()) {
+    if ($entity->tourl()->toString() == $this->currentPath->getPath() && !$comment->id() && !$comment->hasParentComment()) {
       $form['#action'] = $this->url('comment.reply', ['entity_type' => $entity->getEntityTypeId(), 'entity' => $entity->id(), 'field_name' => $field_name]);
     }
 
@@ -397,7 +403,9 @@ public function save(array $form, FormStateInterface $form_state) {
       drupal_set_message($this->t('Comment: unauthorized comment submitted or comment submitted to a closed post %subject.', ['%subject' => $comment->getSubject()]), 'error');
       // Redirect the user to the entity they are commenting on.
     }
-    $form_state->setRedirectUrl($uri);
+    if ($entity->tourl()->toString() == $this->currentPath->getPath() && $uri->access()) {
+      $form_state->setRedirectUrl($uri);
+    }
   }
 
 }
diff --git a/core/modules/comment/tests/src/Functional/CommentBlockContentTest.php b/core/modules/comment/tests/src/Functional/CommentBlockContentTest.php
new file mode 100644
index 0000000000..f178ac30f0
--- /dev/null
+++ b/core/modules/comment/tests/src/Functional/CommentBlockContentTest.php
@@ -0,0 +1,106 @@
+<?php
+
+namespace Drupal\Tests\comment\Functional;
+
+use Drupal\block_content\Entity\BlockContent;
+use Drupal\block_content\Entity\BlockContentType;
+use Drupal\Component\Utility\Unicode;
+use Drupal\Core\Url;
+use Drupal\comment\Entity\CommentType;
+use Drupal\user\RoleInterface;
+
+/**
+ * Tests use of comment field on entity-type without a canonical path.
+ *
+ * @group comment
+ */
+class CommentBlockContentTest extends CommentTestBase {
+
+  /**
+   * Modules to install.
+   *
+   * @var array
+   */
+  public static $modules = ['comment', 'user', 'block_content', 'block'];
+
+  /**
+   * An administrative user with permission to configure comment settings.
+   *
+   * @var \Drupal\user\UserInterface
+   */
+  protected $adminUser;
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+
+    // Create a bundle for entity_test.
+    $type = BlockContentType::create([
+      'id' => 'comments',
+      'label' => 'Comments',
+    ]);
+    $type->save();
+    block_content_add_body_field($type->id());
+    CommentType::create([
+      'id' => 'comment',
+      'label' => 'Comment settings',
+      'description' => 'Comment settings',
+      'target_entity_type_id' => 'block_content',
+    ])->save();
+    // Create comment field on block_content bundle.
+    $this->addDefaultCommentField('block_content', 'comments');
+
+    // Create test user.
+    $this->adminUser = $this->drupalCreateUser(array(
+      'administer comments',
+      'skip comment approval',
+      'post comments',
+      'access comments',
+      'administer blocks',
+    ));
+
+    // Enable anonymous and authenticated user comments.
+    user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, array(
+      'access comments',
+      'post comments',
+      'skip comment approval',
+    ));
+
+    // Create a block and place it.
+    $this->drupalLogin($this->adminUser);
+    $edit = array();
+    $edit['info[0][value]'] = $this->randomMachineName(8);
+    $body = $this->randomMachineName(16);
+    $edit['body[0][value]'] = $body;
+    $this->drupalPostForm('block/add', $edit, t('Save'));
+
+    // Place the block.
+    $instance = array(
+      'id' => Unicode::strtolower($edit['info[0][value]']),
+      'settings[label]' => $edit['info[0][value]'],
+      'region' => 'sidebar_first',
+    );
+    $block = BlockContent::load(1);
+    $url = 'admin/structure/block/add/block_content:' . $block->uuid() . '/' . $this->config('system.theme')->get('default');
+    $this->drupalPostForm($url, $instance, t('Save block'));
+    $this->drupalLogout();
+  }
+
+  /**
+   * Tests anonymous commenting via a block.
+   */
+  public function testAnonymousBlockContentCommenting() {
+    // Navigate to home page.
+    $this->drupalGet('');
+    // Comment on the block.
+    $edit = [];
+    $edit['comment_body[0][value]'] = 'Noni the pony is skinny and bony';
+    $edit['subject[0][value]'] = 'Oh no, why does it go?';
+    $this->drupalPostForm(NULL, $edit, t('Save'));
+    $this->assertSession()->statusCodeEquals(200);
+    $this->assertSession()->addressEquals(Url::fromRoute('user.login'));
+  }
+
+}
