Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

PageRules not work

Open
#241 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
php
Domain
api, cloud

Research direction

Start at the createPageRule entry point used in the issue's PHP example and reproduce the request that returns error 1004. Check the PageRulesTargets and PageRulesActions arguments against the API validation response; done means the example succeeds or the precise validation problem is documented with a regression test.

Written by the indexing model from the issue text.

Description

I`m trying do a page rule redirection, but every time get a error "1004 - Page Rule validation failed: See messages for details"

This is the example of code

        $pageRulesT = new Cloudflare\API\Configurations\PageRulesTargets( "webmail.domain.com/*" ); // Page Rules Targets
        $pageRulesA = new Cloudflare\API\Configurations\PageRulesActions( 301, 'https://mail.zoho.com/zm/' ); // Page Rules Actions
        $pageRules->createPageRule( $zoneID, $pageRulesT, $pageRulesA, true, null );

How to solve this?

Dominant language
PHP
Stars
674
Forks
268
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cloudflare/cloudflare-php

All issues in cloudflare/cloudflare-php

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.