diff --git a/docs/topics/downloader-middleware.rst b/docs/topics/downloader-middleware.rst
index f2f3ef466..fa65f66ed 100644
--- a/docs/topics/downloader-middleware.rst
+++ b/docs/topics/downloader-middleware.rst
@@ -805,6 +805,7 @@ The :class:`MetaRefreshMiddleware` can be configured through the following
 settings (see the settings documentation for more info):
 
 * :setting:`METAREFRESH_ENABLED`
+* :setting:`METAREFRESH_IGNORE_TAGS`
 * :setting:`METAREFRESH_MAXDELAY`
 
 This middleware obey :setting:`REDIRECT_MAX_TIMES` setting, :reqmeta:`dont_redirect`,
@@ -826,6 +827,15 @@ Default: ``True``
 
 Whether the Meta Refresh middleware will be enabled.
 
+.. setting:: METAREFRESH_IGNORE_TAGS
+
+METAREFRESH_IGNORE_TAGS
+^^^^^^^^^^^^^^^^^^^^^^^
+
+Default: ``['script', 'noscript']``
+
+Meta tags within these tags are ignored.
+
 .. setting:: METAREFRESH_MAXDELAY
 
 METAREFRESH_MAXDELAY
diff --git a/scrapy/downloadermiddlewares/redirect.py b/scrapy/downloadermiddlewares/redirect.py
index cb59d3fd2..49468a2e4 100644
--- a/scrapy/downloadermiddlewares/redirect.py
+++ b/scrapy/downloadermiddlewares/redirect.py
@@ -88,6 +88,7 @@ class MetaRefreshMiddleware(BaseRedirectMiddleware):
 
     def __init__(self, settings):
         super(MetaRefreshMiddleware, self).__init__(settings)
+        self._ignore_tags = settings.getlist('METAREFRESH_IGNORE_TAGS')
         self._maxdelay = settings.getint('REDIRECT_MAX_METAREFRESH_DELAY',
                                          settings.getint('METAREFRESH_MAXDELAY'))
 
@@ -96,7 +97,8 @@ class MetaRefreshMiddleware(BaseRedirectMiddleware):
                 not isinstance(response, HtmlResponse):
             return response
 
-        interval, url = get_meta_refresh(response)
+        interval, url = get_meta_refresh(response,
+                                         ignore_tags=self._ignore_tags)
         if url and interval < self._maxdelay:
             redirected = self._redirect_request_using_get(request, url)
             return self._redirect(redirected, request, spider, 'meta refresh')
diff --git a/scrapy/settings/default_settings.py b/scrapy/settings/default_settings.py
index 9986827d8..1ce1516e5 100644
--- a/scrapy/settings/default_settings.py
+++ b/scrapy/settings/default_settings.py
@@ -221,6 +221,7 @@ MEMUSAGE_NOTIFY_MAIL = []
 MEMUSAGE_WARNING_MB = 0
 
 METAREFRESH_ENABLED = True
+METAREFRESH_IGNORE_TAGS = ['script', 'noscript']
 METAREFRESH_MAXDELAY = 100
 
 NEWSPIDER_MODULE = ''
diff --git a/scrapy/utils/response.py b/scrapy/utils/response.py
index bf276b5ca..122af28b0 100644
--- a/scrapy/utils/response.py
+++ b/scrapy/utils/response.py
@@ -31,12 +31,12 @@ def get_base_url(response):
 
 
 _metaref_cache = weakref.WeakKeyDictionary()
-def get_meta_refresh(response):
+def get_meta_refresh(response, ignore_tags=('script', 'noscript')):
     """Parse the http-equiv refrsh parameter from the given response"""
     if response not in _metaref_cache:
         text = response.text[0:4096]
         _metaref_cache[response] = html.get_meta_refresh(text, response.url,
-            response.encoding, ignore_tags=('script', 'noscript'))
+            response.encoding, ignore_tags=ignore_tags)
     return _metaref_cache[response]
 
 

Html http-equiv Tag with status code 200
Dear Scrapy developer,

I crawl following url : 

"http://www.baidu.com/link?url=trNkDflaMpWNZbbB5OphH_bi_8jMpse4zyjTFrexyYw-XAg9M9VmS6YfvsEdUaJEbHKMKfdoPu1LUVMynFNXv1DVVRE6vnmYvCZ1s4jkJae&wd=&eqid=ac8e85b700005ad90000000455c83eee"

and response with status code 200 and content as follow:

```
"<script>window.location.replace("http://testrepository.readthedocs.org/en/latest/MANUAL.html")</script>\n<noscript><META http-equiv="refresh" content="0;URL=\'http://testrepository.readthedocs.org/en/latest/MANUAL.html\'"></noscript>\n"

```

It's won't auto redirect to correct url, why? Maybe it's not scrapy bug, but is there any solution to solve this?

Very thanksful.

Best wishes.

diff --git a/tests/test_downloadermiddleware_redirect.py b/tests/test_downloadermiddleware_redirect.py
index 6c81c94ca..0e841489d 100644
--- a/tests/test_downloadermiddleware_redirect.py
+++ b/tests/test_downloadermiddleware_redirect.py
@@ -279,5 +279,24 @@ class MetaRefreshMiddlewareTest(unittest.TestCase):
         self.assertEqual(req2.meta['redirect_reasons'], ['meta refresh'])
         self.assertEqual(req3.meta['redirect_reasons'], ['meta refresh', 'meta refresh'])
 
+    def test_ignore_tags_default(self):
+        req = Request(url='http://example.org')
+        body = ('''<noscript><meta http-equiv="refresh" '''
+                '''content="0;URL='http://example.org/newpage'"></noscript>''')
+        rsp = HtmlResponse(req.url, body=body.encode())
+        response = self.mw.process_response(req, rsp, self.spider)
+        assert isinstance(response, Response)
+
+    def test_ignore_tags_empty_list(self):
+        crawler = get_crawler(Spider, {'METAREFRESH_IGNORE_TAGS': []})
+        mw = MetaRefreshMiddleware.from_crawler(crawler)
+        req = Request(url='http://example.org')
+        body = ('''<noscript><meta http-equiv="refresh" '''
+                '''content="0;URL='http://example.org/newpage'"></noscript>''')
+        rsp = HtmlResponse(req.url, body=body.encode())
+        req2 = mw.process_response(req, rsp, self.spider)
+        assert isinstance(req2, Request)
+        self.assertEqual(req2.url, 'http://example.org/newpage')
+
 if __name__ == "__main__":
     unittest.main()

pip install -e .
parse_log_pytest
requirements.txt
pytest
apt-get update apt-get install -y python3-dev libxml2-dev libxslt1-dev zlib1g-dev libffi-dev libssl-dev
3.9
requirements-py3.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs==25.3.0
Automat==24.8.1
cffi==1.17.1
constantly==23.10.4
cryptography==44.0.2
cssselect==1.3.0
exceptiongroup==1.2.2
hyperlink==21.0.0
idna==3.10
incremental==24.7.2
iniconfig==2.1.0
jmespath==1.0.1
lxml==5.3.1
packaging==24.2
parsel==1.10.0
pluggy==1.5.0
pyasn1==0.6.1
pyasn1_modules==0.4.2
pycparser==2.22
PyDispatcher==2.0.7
pyOpenSSL==25.0.0
pytest==8.3.5
queuelib==1.7.0
-e git+https://github.com/scrapy/scrapy.git@6e49c379a8ecfe92c99a37b6bb6d7e440df56bd9#egg=Scrapy
service-identity==24.2.0
six==1.17.0
tomli==2.2.1
Twisted==24.11.0
typing_extensions==4.13.0
w3lib==2.3.1
zope.interface==7.2

name: scrapy
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - attrs==25.3.0
      - automat==24.8.1
      - cffi==1.17.1
      - constantly==23.10.4
      - cryptography==44.0.2
      - cssselect==1.3.0
      - exceptiongroup==1.2.2
      - hyperlink==21.0.0
      - idna==3.10
      - incremental==24.7.2
      - iniconfig==2.1.0
      - jmespath==1.0.1
      - lxml==5.3.1
      - packaging==24.2
      - parsel==1.10.0
      - pluggy==1.5.0
      - pyasn1==0.6.1
      - pyasn1-modules==0.4.2
      - pycparser==2.22
      - pydispatcher==2.0.7
      - pyopenssl==25.0.0
      - pytest==8.3.5
      - queuelib==1.7.0
      - service-identity==24.2.0
      - six==1.17.0
      - tomli==2.2.1
      - twisted==24.11.0
      - typing-extensions==4.13.0
      - w3lib==2.3.1
      - zope-interface==7.2
prefix: /opt/conda/envs/scrapy

tests/test_downloadermiddleware_redirect.py::MetaRefreshMiddlewareTest::test_ignore_tags_empty_list
tests/test_downloadermiddleware_redirect.py::RedirectMiddlewareTest::test_dont_redirect tests/test_downloadermiddleware_redirect.py::RedirectMiddlewareTest::test_latin1_location tests/test_downloadermiddleware_redirect.py::RedirectMiddlewareTest::test_max_redirect_times tests/test_downloadermiddleware_redirect.py::RedirectMiddlewareTest::test_priority_adjust tests/test_downloadermiddleware_redirect.py::RedirectMiddlewareTest::test_redirect_302 tests/test_downloadermiddleware_redirect.py::RedirectMiddlewareTest::test_redirect_302_head tests/test_downloadermiddleware_redirect.py::RedirectMiddlewareTest::test_redirect_3xx_permanent tests/test_downloadermiddleware_redirect.py::RedirectMiddlewareTest::test_redirect_reasons tests/test_downloadermiddleware_redirect.py::RedirectMiddlewareTest::test_redirect_urls tests/test_downloadermiddleware_redirect.py::RedirectMiddlewareTest::test_request_meta_handling tests/test_downloadermiddleware_redirect.py::RedirectMiddlewareTest::test_spider_handling tests/test_downloadermiddleware_redirect.py::RedirectMiddlewareTest::test_ttl tests/test_downloadermiddleware_redirect.py::RedirectMiddlewareTest::test_utf8_location tests/test_downloadermiddleware_redirect.py::MetaRefreshMiddlewareTest::test_ignore_tags_default tests/test_downloadermiddleware_redirect.py::MetaRefreshMiddlewareTest::test_max_redirect_times tests/test_downloadermiddleware_redirect.py::MetaRefreshMiddlewareTest::test_meta_refresh tests/test_downloadermiddleware_redirect.py::MetaRefreshMiddlewareTest::test_meta_refresh_trough_posted_request tests/test_downloadermiddleware_redirect.py::MetaRefreshMiddlewareTest::test_meta_refresh_with_high_interval tests/test_downloadermiddleware_redirect.py::MetaRefreshMiddlewareTest::test_priority_adjust tests/test_downloadermiddleware_redirect.py::MetaRefreshMiddlewareTest::test_redirect_reasons tests/test_downloadermiddleware_redirect.py::MetaRefreshMiddlewareTest::test_redirect_urls tests/test_downloadermiddleware_redirect.py::MetaRefreshMiddlewareTest::test_ttl
docs/topics/downloader-middleware.rst scrapy/downloadermiddlewares/redirect.py scrapy/utils/response.py scrapy/settings/default_settings.py
docs/topics/downloader-middleware.rst scrapy/downloadermiddlewares/redirect.py scrapy/utils/response.py scrapy/settings/default_settings.py