Compare commits
No commits in common. "a6c51419205b6c11ce1286c1db76d6ca2808929d" and "b1fff97254134a15841ad382f29ba8c120204876" have entirely different histories.
a6c5141920
...
b1fff97254
@ -4,7 +4,7 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"build": "next build && node scripts/copy-htaccess.cjs",
|
"build": "next build",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"lint": "eslint",
|
"lint": "eslint",
|
||||||
"sitemap": "node scripts/generate-sitemap.cjs"
|
"sitemap": "node scripts/generate-sitemap.cjs"
|
||||||
|
|||||||
@ -1,61 +1,36 @@
|
|||||||
# Antalya Restaurant - Apache Configuration
|
|
||||||
# Handles trailing slashes and prevents 403 errors
|
|
||||||
|
|
||||||
<IfModule mod_rewrite.c>
|
<IfModule mod_rewrite.c>
|
||||||
RewriteEngine On
|
RewriteEngine On
|
||||||
RewriteBase /
|
RewriteBase /
|
||||||
|
|
||||||
# Force HTTPS (optional, uncomment if needed)
|
# Allow Next.js static files and assets
|
||||||
# RewriteCond %{HTTPS} off
|
RewriteRule ^_next/ - [L]
|
||||||
# RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
|
RewriteRule ^static/ - [L]
|
||||||
|
|
||||||
# Handle trailing slashes
|
# Serve existing files or directories directly
|
||||||
# If a directory exists with the name, serve its index.html
|
RewriteCond %{REQUEST_FILENAME} -f [OR]
|
||||||
RewriteCond %{REQUEST_FILENAME} !-f
|
RewriteCond %{REQUEST_FILENAME} -d
|
||||||
RewriteCond %{REQUEST_URI} !(.*)/$
|
RewriteRule ^ - [L]
|
||||||
RewriteCond %{REQUEST_FILENAME}/index.html -f
|
|
||||||
RewriteRule ^(.*)$ $1/ [R=301,L]
|
|
||||||
|
|
||||||
# Serve index.html for directories
|
# Redirect extensionless URLs to trailing slash directories
|
||||||
RewriteCond %{REQUEST_FILENAME} -d
|
# Works with "trailingSlash: true" and static export
|
||||||
RewriteRule ^(.*)$ $1/index.html [L]
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
|
RewriteCond %{REQUEST_URI} !/$
|
||||||
|
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI}/index.html -f
|
||||||
|
RewriteRule ^(.+)$ /$1/ [R=301,L]
|
||||||
|
|
||||||
# Specific rewrites for main pages (with and without trailing slash)
|
# Apache 404 (Next.js static export supports 404.html)
|
||||||
RewriteRule ^about-antalya-restaurant/?$ about-antalya-restaurant/index.html [L]
|
ErrorDocument 404 /404.html
|
||||||
RewriteRule ^antalya-restaurant-menu/?$ antalya-restaurant-menu/index.html [L]
|
|
||||||
RewriteRule ^antalya-restaurant-gallery/?$ antalya-restaurant-gallery/index.html [L]
|
|
||||||
RewriteRule ^book-a-table/?$ book-a-table/index.html [L]
|
|
||||||
RewriteRule ^catering-services-ontario/?$ catering-services-ontario/index.html [L]
|
|
||||||
RewriteRule ^antalya-turkish-food-blog/?$ antalya-turkish-food-blog/index.html [L]
|
|
||||||
|
|
||||||
# Blog posts
|
|
||||||
RewriteRule ^antalya-turkish-food-blog/([^/]+)/?$ antalya-turkish-food-blog/$1/index.html [L]
|
|
||||||
|
|
||||||
# Prevent directory listing
|
|
||||||
Options -Indexes
|
|
||||||
|
|
||||||
# Custom error pages
|
|
||||||
ErrorDocument 404 /404.html
|
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
|
||||||
# Security Headers
|
|
||||||
<IfModule mod_headers.c>
|
<IfModule mod_headers.c>
|
||||||
Header set X-Content-Type-Options "nosniff"
|
# Cache static assets aggressively
|
||||||
Header set X-Frame-Options "DENY"
|
<FilesMatch "\.(js|css|png|jpg|jpeg|gif|ico|svg|webp)$">
|
||||||
Header set X-XSS-Protection "1; mode=block"
|
Header set Cache-Control "public, max-age=31536000, immutable"
|
||||||
</IfModule>
|
</FilesMatch>
|
||||||
|
|
||||||
# Cache Control
|
# HTML is not cached (important for updated content)
|
||||||
<IfModule mod_expires.c>
|
<FilesMatch "\.(html)$">
|
||||||
ExpiresActive On
|
Header set Cache-Control "public, max-age=0, must-revalidate"
|
||||||
ExpiresByType image/jpg "access plus 1 year"
|
</FilesMatch>
|
||||||
ExpiresByType image/jpeg "access plus 1 year"
|
|
||||||
ExpiresByType image/gif "access plus 1 year"
|
|
||||||
ExpiresByType image/png "access plus 1 year"
|
|
||||||
ExpiresByType image/webp "access plus 1 year"
|
|
||||||
ExpiresByType image/svg+xml "access plus 1 year"
|
|
||||||
ExpiresByType text/css "access plus 1 year"
|
|
||||||
ExpiresByType text/javascript "access plus 1 year"
|
|
||||||
ExpiresByType application/javascript "access plus 1 year"
|
|
||||||
ExpiresByType image/x-icon "access plus 1 year"
|
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
|||||||
@ -1,18 +0,0 @@
|
|||||||
const fs = require('fs');
|
|
||||||
const path = require('path');
|
|
||||||
|
|
||||||
// Copy .htaccess from public to out directory after build
|
|
||||||
const source = path.join(__dirname, '..', 'public', '.htaccess');
|
|
||||||
const destination = path.join(__dirname, '..', 'out', '.htaccess');
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (fs.existsSync(source)) {
|
|
||||||
fs.copyFileSync(source, destination);
|
|
||||||
console.log('✓ .htaccess copied to out directory');
|
|
||||||
} else {
|
|
||||||
console.warn('⚠ .htaccess not found in public directory');
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error copying .htaccess:', error.message);
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
29
vercel.json
29
vercel.json
@ -1,61 +1,34 @@
|
|||||||
{
|
{
|
||||||
"trailingSlash": true,
|
"trailingSlash": true,
|
||||||
|
"cleanUrls": false,
|
||||||
"rewrites": [
|
"rewrites": [
|
||||||
{
|
{
|
||||||
"source": "/about-antalya-restaurant",
|
"source": "/about-antalya-restaurant",
|
||||||
"destination": "/about-antalya-restaurant/index.html"
|
"destination": "/about-antalya-restaurant/index.html"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"source": "/about-antalya-restaurant/",
|
|
||||||
"destination": "/about-antalya-restaurant/index.html"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"source": "/antalya-restaurant-menu",
|
"source": "/antalya-restaurant-menu",
|
||||||
"destination": "/antalya-restaurant-menu/index.html"
|
"destination": "/antalya-restaurant-menu/index.html"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"source": "/antalya-restaurant-menu/",
|
|
||||||
"destination": "/antalya-restaurant-menu/index.html"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"source": "/antalya-restaurant-gallery",
|
"source": "/antalya-restaurant-gallery",
|
||||||
"destination": "/antalya-restaurant-gallery/index.html"
|
"destination": "/antalya-restaurant-gallery/index.html"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"source": "/antalya-restaurant-gallery/",
|
|
||||||
"destination": "/antalya-restaurant-gallery/index.html"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"source": "/book-a-table",
|
"source": "/book-a-table",
|
||||||
"destination": "/book-a-table/index.html"
|
"destination": "/book-a-table/index.html"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"source": "/book-a-table/",
|
|
||||||
"destination": "/book-a-table/index.html"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"source": "/catering-services-ontario",
|
"source": "/catering-services-ontario",
|
||||||
"destination": "/catering-services-ontario/index.html"
|
"destination": "/catering-services-ontario/index.html"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"source": "/catering-services-ontario/",
|
|
||||||
"destination": "/catering-services-ontario/index.html"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"source": "/antalya-turkish-food-blog",
|
"source": "/antalya-turkish-food-blog",
|
||||||
"destination": "/antalya-turkish-food-blog/index.html"
|
"destination": "/antalya-turkish-food-blog/index.html"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"source": "/antalya-turkish-food-blog/",
|
|
||||||
"destination": "/antalya-turkish-food-blog/index.html"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"source": "/antalya-turkish-food-blog/:slug",
|
"source": "/antalya-turkish-food-blog/:slug",
|
||||||
"destination": "/antalya-turkish-food-blog/:slug/index.html"
|
"destination": "/antalya-turkish-food-blog/:slug/index.html"
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "/antalya-turkish-food-blog/:slug/",
|
|
||||||
"destination": "/antalya-turkish-food-blog/:slug/index.html"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"headers": [
|
"headers": [
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user