86 lines
2.8 KiB
Markdown
86 lines
2.8 KiB
Markdown
|
|
# Website Consolidation Complete - December 14, 2025
|
||
|
|
|
||
|
|
## Problem Identified
|
||
|
|
You were seeing TWO DIFFERENT websites:
|
||
|
|
- **localhost** → Was serving from `/var/www/html/` (default nginx, old site)
|
||
|
|
- **skyarts.ddns.net** → Was serving from `/var/www/skyartshop/public/` (your new site)
|
||
|
|
|
||
|
|
## Root Cause
|
||
|
|
The nginx configuration only had `server_name skyarts.ddns.net;` which meant:
|
||
|
|
- Requests to skyarts.ddns.net went to the skyartshop config
|
||
|
|
- Requests to localhost fell back to the default nginx config at `/var/www/html/`
|
||
|
|
|
||
|
|
## Solution Implemented
|
||
|
|
Updated nginx configuration to handle BOTH localhost and skyarts.ddns.net:
|
||
|
|
|
||
|
|
### Changed Config
|
||
|
|
```nginx
|
||
|
|
# Before - only handled skyarts.ddns.net
|
||
|
|
server {
|
||
|
|
listen 80;
|
||
|
|
server_name skyarts.ddns.net;
|
||
|
|
return 301 https://$server_name$request_uri;
|
||
|
|
}
|
||
|
|
|
||
|
|
# After - handles both localhost and skyarts.ddns.net
|
||
|
|
server {
|
||
|
|
listen 80;
|
||
|
|
server_name localhost skyarts.ddns.net;
|
||
|
|
|
||
|
|
# Redirect to HTTPS only for skyarts.ddns.net
|
||
|
|
if ($host = skyarts.ddns.net) {
|
||
|
|
return 301 https://$server_name$request_uri;
|
||
|
|
}
|
||
|
|
|
||
|
|
# For localhost, serve the site over HTTP
|
||
|
|
root /var/www/skyartshop/public;
|
||
|
|
# ... rest of config
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
## Result
|
||
|
|
✅ **BOTH URLs now serve THE SAME SITE from `/var/www/skyartshop/public/`**
|
||
|
|
|
||
|
|
- ✅ localhost → Serves over HTTP (no redirect)
|
||
|
|
- ✅ skyarts.ddns.net → Redirects to HTTPS, then serves same content
|
||
|
|
- ✅ Same navbar, same layout, same pages
|
||
|
|
- ✅ All your new modifications preserved
|
||
|
|
- ✅ Admin panel accessible on both URLs
|
||
|
|
|
||
|
|
## Verification
|
||
|
|
```bash
|
||
|
|
# Both show identical content
|
||
|
|
curl http://localhost/home.html
|
||
|
|
curl https://skyarts.ddns.net/home.html
|
||
|
|
|
||
|
|
# Both show: <title>Home - Sky Art Shop</title>
|
||
|
|
# Both show: <nav class="modern-navbar">
|
||
|
|
# Both show: same hero section
|
||
|
|
```
|
||
|
|
|
||
|
|
## Files Modified
|
||
|
|
- `/etc/nginx/sites-enabled/skyartshop` - Updated to handle localhost
|
||
|
|
- `/etc/nginx/sites-available/skyartshop` - Same update
|
||
|
|
- Created: `/media/pts/Website/SkyArtShop/nginx-skyartshop-localhost.conf` - Source config file
|
||
|
|
|
||
|
|
## What Happens Now
|
||
|
|
1. **localhost** - Serves your site over HTTP (port 80)
|
||
|
|
2. **skyarts.ddns.net** - Redirects to HTTPS (port 443), serves same site
|
||
|
|
3. **No more dual sites** - One codebase at `/var/www/skyartshop/public/`
|
||
|
|
4. **All modifications preserved** - Your new admin panel, authentication, everything
|
||
|
|
|
||
|
|
## Next Steps
|
||
|
|
- **Clear browser cache** - Press Ctrl+Shift+Delete and clear cache
|
||
|
|
- **Test localhost** - Should show your modern site now
|
||
|
|
- **Test skyarts.ddns.net** - Should show identical site
|
||
|
|
- **Confirm admin panel** - Should work on both URLs
|
||
|
|
|
||
|
|
## Old Site Location (For Reference)
|
||
|
|
The old site was at `/var/www/html/` (default nginx). You can:
|
||
|
|
- Delete it if you don't need it: `sudo rm -rf /var/www/html/*`
|
||
|
|
- Or keep it as a backup
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
**Status: ✅ COMPLETE - Both URLs now serve the same unified site**
|