AI SEO Guide

Technical SEO Prompts (Log Files, Regex, Hreflang)

AI SEOPublished Jul 18, 20263 min readLinkedInX

Technical SEO prompts have less tolerance for confident-sounding wrong answers than content prompts do. A hallucinated blog intro is embarrassing; a hallucinated regex pattern or canonical recommendation can break a live site. These prompts lean on the model’s strength — explaining and drafting — while keeping verification in your hands, not the model’s.

Log File Analysis

Paste sample log lines (with any sensitive IPs or paths redacted) rather than describing them:

  • “Given these log lines [paste sample], which of these requests are from Googlebot vs. a spoofed user-agent, and how would I verify that?”
  • “What does this pattern of repeated 404s in my logs [paste] suggest about broken internal links or an old URL structure?”
  • “Given this crawl frequency breakdown by directory [paste/describe], which sections is Googlebot under-crawling relative to their size?”

Regex and Rewrite Rules

  • “Write a regex pattern that matches [describe URL pattern] but not [describe exception] — then explain what each part of the pattern does.”
  • “Review this .htaccess rewrite rule [paste] and explain exactly which URLs it redirects and which it leaves untouched.
  • “Convert this Apache rewrite rule [paste] to the Nginx equivalent.”
  • “Does this regex [paste] have a catastrophic backtracking risk on long input strings?”

Hreflang and Canonicals

  • “Review this hreflang set [paste] for missing return tags — every page should reference every other language version, including itself.”
  • “Given these URL variants [paste: with/without trailing slash, with/without www, with UTM parameters], what canonical tag should each point to?”
  • “Explain the practical difference between rel=canonical and a 301 redirect for this duplicate-content scenario: [describe].”
  • “Given this hreflang code [paste], is ‘x-default’ being used correctly for the language-neutral fallback?”

Crawl Errors, Plain English

  • “Explain what this Search Console error [paste exact error text] means, in plain English, for someone who isn’t a developer.”
  • “What are the 3 most common causes of ‘[error type]’, ranked by how often each actually turns out to be the cause?”
  • “Given this robots.txt [paste], would it block Googlebot from crawling [specific URL], step through the rule matching.”

Guardrails

Never deploy a regex pattern, rewrite rule, or redirect the model generates without testing it against real sample URLs first — including edge cases and URLs it should NOT match. Ask the model to explain its own pattern back to you in plain English as a sanity check; if the explanation doesn’t match what you intended, the pattern is wrong even if it looks plausible.

Key Takeaways

  • Paste real log lines, rules, and error text into the prompt — don’t describe them from memory.
  • Always ask the model to explain a generated regex or rewrite rule back in plain English before deploying it, as a sanity check.
  • Test every generated redirect/rewrite rule against real sample URLs, including cases it should NOT match, before going live.

Frequently Asked Questions

Can I trust AI-generated regex without testing it?

No. Regex looks deceptively simple but has many edge cases (greedy matching, escaping special characters, catastrophic backtracking). Always test against a batch of real URLs, including ones that should NOT match, before deploying.

Can a model actually read my server log files?

Only if you paste the relevant lines into the chat — it has no live access to your server. For large-scale log analysis, a dedicated log analyzer tool is more practical; use the model to interpret patterns you’ve already pulled out.

Is it safe to ask AI to write .htaccess or Nginx rules directly?

Draft with AI, but review and test every rule yourself before deploying — a malformed rewrite rule can take down an entire site section, and the model can’t test against your live server.

Further reading & sources

See how your site actually shows up in AI search. An AI visibility audit maps where you’re cited, where you’re invisible, and what to fix first — in plain English.

Get your AI visibility auditTry the free SEO tools →

Prefer self-serve? The interactive checklists turn guides like this one into a working to-do list.

Keep reading in AI SEO

Get one email when something genuinely changes

AI search moves fast and most of it is noise. We send one short email when a real shift is worth your time. Unsubscribe anytime.

Published by Plain Intelligence — practical AI SEO, GEO, and technical SEO, documented in plain English. About Plain Intelligence →

↑ Back to AI SEO · Explore all articles · Free tools & resources · Glossary