Skip to content

fix: add 301 redirects from /documentation/* to /docs/*#199

Merged
ManukMinasyan merged 3 commits intomainfrom
fix/documentation-redirects
Mar 29, 2026
Merged

fix: add 301 redirects from /documentation/* to /docs/*#199
ManukMinasyan merged 3 commits intomainfrom
fix/documentation-redirects

Conversation

@ManukMinasyan
Copy link
Copy Markdown
Contributor

Summary

  • Old /documentation/* URLs return 404 (reported by OhDear sitemap check)
  • Docs now live at /docs/*
  • Add permanent 301 redirect to preserve SEO equity and fix 5 broken sitemap URLs

Test plan

  • /documentation/docs (301)
  • /documentation/api/docs/api (301)
  • /documentation/getting-started/docs/getting-started (301)
  • Regenerate sitemap after deploy: php artisan app:generate-sitemap

- Add min:20 validation to contact form message field
- Use API_DOMAIN env var for Scribe docs base URL when set
Hidden tab panels used visibility:hidden which preserves layout space,
causing the tallest panel (AI Agent chat) to force container height for
all tabs. Switch hidden panels to absolute positioning so only the
active panel determines container height.
Old documentation URLs return 404 and are indexed in the sitemap.
Redirect permanently to preserve SEO equity and fix external links.
Copilot AI review requested due to automatic review settings March 29, 2026 19:25
@ManukMinasyan ManukMinasyan merged commit 38e75d4 into main Mar 29, 2026
11 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for legacy documentation URLs by redirecting old /documentation/* routes to the current /docs/* location, addressing broken sitemap links and preserving SEO value.

Changes:

  • Added a permanent redirect from /documentation/{slug?} to /docs/{slug?}.
  • Adjusted homepage hero tab panel positioning/visibility behavior.
  • Updated Scribe API docs base URL logic and tightened contact form validation (minimum message length).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
routes/web.php Adds legacy /documentation/*/docs/* redirect route.
resources/views/home/partials/hero.blade.php Updates hero tab panel layout classes and show/hide behavior.
config/scribe.php Changes Scribe base_url computation when app.api_domain is configured.
app/Http/Requests/ContactRequest.php Adds a minimum length constraint to contact form message validation.

// The base URL displayed in the docs.
// If you're using `laravel` type, you can set this to a dynamic string, like '{{ config("app.tenant_url") }}' to get a dynamic base URL.
'base_url' => config('app.url'),
'base_url' => config('app.api_domain') ? 'https://'.config('app.api_domain') : config('app.url'),
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is described as only adding legacy /documentation/* redirects, but it also includes unrelated changes (Scribe base_url, homepage hero tab styling, and contact form validation). Either update the PR description/test plan to cover these behaviors or split them into separate PRs to keep scope focused and reviewable.

Copilot uses AI. Check for mistakes.
// The base URL displayed in the docs.
// If you're using `laravel` type, you can set this to a dynamic string, like '{{ config("app.tenant_url") }}' to get a dynamic base URL.
'base_url' => config('app.url'),
'base_url' => config('app.api_domain') ? 'https://'.config('app.api_domain') : config('app.url'),
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

base_url hardcodes https:// and drops any scheme/port configured in app.url (eg local http://localhost:8000 or non-443 ports). This can generate incorrect URLs in the rendered API docs; consider deriving scheme + port from config('app.url') (similar to the URL::getApiUrl macro logic) when app.api_domain is set.

Copilot uses AI. Check for mistakes.
Comment on lines +59 to +61
Route::get('/documentation/{slug?}', fn (string $slug = '') => redirect("/docs/{$slug}", 301))
->where('slug', '.*');

Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When slug is empty (eg requesting /documentation), this redirects to /docs/ (trailing slash) rather than /docs as described in the test plan. Consider building the target path conditionally (only add /$slug when non-empty) and normalizing leading/trailing slashes to avoid // in edge cases.

Suggested change
Route::get('/documentation/{slug?}', fn (string $slug = '') => redirect("/docs/{$slug}", 301))
->where('slug', '.*');
Route::get('/documentation/{slug?}', function (?string $slug = null) {
$normalizedSlug = ltrim((string) $slug, '/');
$path = '/docs';
if ($normalizedSlug !== '') {
$path .= '/' . $normalizedSlug;
}
return redirect($path, 301);
})->where('slug', '.*');

Copilot uses AI. Check for mistakes.
'email' => ['required', 'email:rfc,dns', 'max:255'],
'company' => ['nullable', 'string', 'max:255'],
'message' => ['required', 'string', 'max:5000'],
'message' => ['required', 'string', 'min:20', 'max:5000'],
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds a new validation constraint (min:20) for contact messages, but there are no feature tests covering the /contact form submission/validation behavior. Please add tests for both the rejection case (<20 chars) and acceptance case (>=20) so this change is protected against regressions.

Copilot generated this review using guidance from repository custom instructions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants