RewriteEngine On 
RewriteCond %{HTTPS} off 
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]

RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R=302,L,NE]

# Force HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Remove trailing slash from all URLs except directories
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^(.+)/$
RewriteRule ^ %1 [L,R=301]

# Remove .php extension from URLs
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^([^\.]+)$ $1.php [NC,L]

# Redirect .php URLs to clean URLs (e.g., /page.php -> /page)
RewriteCond %{THE_REQUEST} \s/([^.]+)\.php [NC]
RewriteRule ^ %1 [R=302,L,NE]



# Specific Redirects
Redirect 301 /top-self-publishing-companies-for-new-authors-in-2024 https://ebookghostwriting.services/blog/top-self-publishing-companies-for-new-authors-in-2024
Redirect 301 /20-best-book-publishers-in-california https://ebookghostwriting.services/blog/20-best-book-publishers-in-california
Redirect 301 /what-to-write-in-a-yearbook https://ebookghostwriting.services/blog/what-to-write-in-a-yearbook
Redirect 301 /25-top-book-publishers-in-illinois https://ebookghostwriting.services/blog/25-top-book-publishers-in-illinois
Redirect 301 /advantages-of-hiring-ebook-ghostwriting-services https://ebookghostwriting.services/blog/advantages-of-hiring-ebook-ghostwriting-services
Redirect 301 /ebook-and-ghostwriting-services-to-hire https://ebookghostwriting.services/blog/ebook-and-ghostwriting-services-to-hire
Redirect 301 /brief-an-ebook-ghostwriter-for-clarity https://ebookghostwriting.services/blog/brief-an-ebook-ghostwriter-for-clarity
Redirect 301 /why-ebook-ghostwriters-are-the-secret-ingredient-behind-many-bestsellers https://ebookghostwriting.services/blog/why-ebook-ghostwriters-are-the-secret-ingredient-behind-many-bestsellers
Redirect 301 /being-an-ebook-ghostwriter-can-help-you-monetize-your-expertise https://ebookghostwriting.services/blog/being-an-ebook-ghostwriter-can-help-you-monetize-your-expertise
Redirect 301 /hiring-an-ebook-ghostwriter-worth-it https://ebookghostwriting.services/blog/hiring-an-ebook-ghostwriter-worth-it
Redirect 301 /top-writing-trends-for-ebooks-in-2024 https://ebookghostwriting.services/blog/top-writing-trends-for-ebooks-in-2024
Redirect 301 /traits-of-a-high-quality-ebook-ghostwriter https://ebookghostwriting.services/blog/traits-of-a-high-quality-ebook-ghostwriter
Redirect 301 /how-much-does-ebook-ghostwriting-cost https://ebookghostwriting.services/blog/how-much-does-ebook-ghostwriting-cost
Redirect 301 /mistakes-to-avoid-when-hiring-an-ebook-ghostwriter https://ebookghostwriting.services/blog/mistakes-to-avoid-when-hiring-an-ebook-ghostwriter
Redirect 301 /market-an-ebook https://ebookghostwriting.services/blog/market-an-ebook
Redirect 301 /hiring-a-ghostwriter-for-your-ebook https://ebookghostwriting.services/blog/hiring-a-ghostwriter-for-your-ebook
Redirect 301 /how-long-does-it-take-to-write-an-ebook-with-a-ghostwriter https://ebookghostwriting.services/blog/how-long-does-it-take-to-write-an-ebook-with-a-ghostwriter
Redirect 301 /qualities-to-look-for-in-an-ebook-ghostwriter https://ebookghostwriting.services/blog/qualities-to-look-for-in-an-ebook-ghostwriter
Redirect 301 /are-you-interested-in-writing-an-ebook https://ebookghostwriting.services/blog/are-you-interested-in-writing-an-ebook
Redirect 301 /start-your-ebook-writing-journey https://ebookghostwriting.services/blog/start-your-ebook-writing-journey
Redirect 301 /how-to-write-a-romance-novel https://ebookghostwriting.services/blog/how-to-write-a-romance-novel
Redirect 301 /how-to-write-a-horror-story-in-12-steps-with-examples https://ebookghostwriting.services/blog/how-to-write-a-horror-story-in-12-steps-with-examples
Redirect 301 /how-can-i-find-a-ghostwriter-for-my-book https://ebookghostwriting.services/blog/how-can-i-find-a-ghostwriter-for-my-book
Redirect 301 /what-is-ghostwriting-and-how-will-it-benefit-your-business https://ebookghostwriting.services/blog/what-is-ghostwriting-and-how-will-it-benefit-your-business
Redirect 301 /how-do-you-start-writing-a-book-about-your-life https://ebookghostwriting.services/blog/how-do-you-start-writing-a-book-about-your-life
Redirect 301 /why-you-should-use-ghostwriting-services-for-your-business https://ebookghostwriting.services/blog/why-you-should-use-ghostwriting-services-for-your-business
Redirect 301 /the-significance-of-ghostwriting-services-for-a-business/ https://ebookghostwriting.services/blog/the-significance-of-ghostwriting-services-for-a-business/
Redirect 301 /everything-to-know-about-ghostwriting-services https://ebookghostwriting.services/blog/everything-to-know-about-ghostwriting-services
Redirect 301 /the-perks-of-using-professional-ghostwriting-services https://ebookghostwriting.services/blog/the-perks-of-using-professional-ghostwriting-services
Redirect 301 /what-is-ghostwriting-the-ins-and-outs https://ebookghostwriting.services/blog/what-is-ghostwriting-the-ins-and-outs
Redirect 301 /why-ghostwriter-is-important-for-a-book https://ebookghostwriting.services/blog/why-ghostwriter-is-important-for-a-book
Redirect 301 /everything-to-know-about-ghostwriters-for-books https://ebookghostwriting.services/blog/everything-to-know-about-ghostwriters-for-books
Redirect 301 /how-to-find-a-ghostwriter-to-write-my-story https://ebookghostwriting.services/blog/how-to-find-a-ghostwriter-to-write-my-story


Redirect 301 /book-marketing https://ebookghostwriting.services/book-marketing-company
Redirect 301 /home/ebookghostwritin/public_html/thank-you https://ebookghostwriting.services/thank-you



##Block bad bots
RewriteEngine On 
RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [OR]
RewriteCond %{HTTP_USER_AGENT} ^Bot\ mailto:craftbot@yahoo.com [OR]
RewriteCond %{HTTP_USER_AGENT} ^ChinaClaw [OR]
RewriteCond %{HTTP_USER_AGENT} ^Custo [OR]
RewriteCond %{HTTP_USER_AGENT} ^DISCo [OR]
RewriteCond %{HTTP_USER_AGENT} ^Download\ Demon [OR]
RewriteCond %{HTTP_USER_AGENT} ^eCatch [OR]
RewriteCond %{HTTP_USER_AGENT} ^EirGrabber [OR]
RewriteCond %{HTTP_USER_AGENT} ^EmailSiphon [OR]
RewriteCond %{HTTP_USER_AGENT} ^EmailWolf [OR]
RewriteCond %{HTTP_USER_AGENT} ^Express\ WebPictures [OR]
RewriteCond %{HTTP_USER_AGENT} ^ExtractorPro [OR]
RewriteCond %{HTTP_USER_AGENT} ^EyeNetIE [OR]
RewriteCond %{HTTP_USER_AGENT} ^FlashGet [OR]
RewriteCond %{HTTP_USER_AGENT} ^GetRight [OR]
RewriteCond %{HTTP_USER_AGENT} ^GetWeb! [OR]
RewriteCond %{HTTP_USER_AGENT} ^Go!Zilla [OR]
RewriteCond %{HTTP_USER_AGENT} ^Go-Ahead-Got-It [OR]
RewriteCond %{HTTP_USER_AGENT} ^GrabNet [OR]
RewriteCond %{HTTP_USER_AGENT} ^Grafula [OR]
RewriteCond %{HTTP_USER_AGENT} ^HMView [OR]
RewriteCond %{HTTP_USER_AGENT} HTTrack [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Image\ Stripper [OR]
RewriteCond %{HTTP_USER_AGENT} ^Image\ Sucker [OR]
RewriteCond %{HTTP_USER_AGENT} Indy\ Library [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^InterGET [OR]
RewriteCond %{HTTP_USER_AGENT} ^Internet\ Ninja [OR]
RewriteCond %{HTTP_USER_AGENT} ^JetCar [OR]
RewriteCond %{HTTP_USER_AGENT} ^JOC\ Web\ Spider [OR]
RewriteCond %{HTTP_USER_AGENT} ^larbin [OR]
RewriteCond %{HTTP_USER_AGENT} ^LeechFTP [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mass\ Downloader [OR]
RewriteCond %{HTTP_USER_AGENT} ^MIDown\ tool [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mister\ PiX [OR]
RewriteCond %{HTTP_USER_AGENT} uuuu7u^Navroad [OR]
RewriteCond %{HTTP_USER_AGENT} ^NearSite [OR]
RewriteCond %{HTTP_USER_AGENT} ^NetAnts [OR]
RewriteCond %{HTTP_USER_AGENT} ^NetSpider [OR]
RewriteCond %{HTTP_USER_AGENT} ^Net\ Vampire [OR]
RewriteCond %{HTTP_USER_AGENT} ^NetZIP [OR]
RewriteCond %{HTTP_USER_AGENT} ^Octopus [OR]
RewriteCond %{HTTP_USER_AGENT} ^Offline\ Explorer [OR]
RewriteCond %{HTTP_USER_AGENT} ^Offline\ Navigator [OR]
RewriteCond %{HTTP_USER_AGENT} ^PageGrabber [OR]
RewriteCond %{HTTP_USER_AGENT} ^Papa\ Foto [OR]
RewriteCond %{HTTP_USER_AGENT} ^pavuk [OR]
RewriteCond %{HTTP_USER_AGENT} ^pcBrowser [OR]
RewriteCond %{HTTP_USER_AGENT} ^RealDownload [OR]
RewriteCond %{HTTP_USER_AGENT} ^ReGet [OR]
RewriteCond %{HTTP_USER_AGENT} ^SiteSnagger [OR]
RewriteCond %{HTTP_USER_AGENT} ^SmartDownload [OR]
RewriteCond %{HTTP_USER_AGENT} ^SuperBot [OR]
RewriteCond %{HTTP_USER_AGENT} ^SuperHTTP [OR]
RewriteCond %{HTTP_USER_AGENT} ^Surfbot [OR]
RewriteCond %{HTTP_USER_AGENT} ^tAkeOut [OR]
RewriteCond %{HTTP_USER_AGENT} ^Teleport\ Pro [OR]
RewriteCond %{HTTP_USER_AGENT} ^VoidEYE [OR]
RewriteCond %{HTTP_USER_AGENT} ^Web\ Image\ Collector [OR]
RewriteCond %{HTTP_USER_AGENT} ^Web\ Sucker [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebAuto [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebCopier [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebFetch [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebGo\ IS [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebLeacher [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebReaper [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebSauger [OR]
RewriteCond %{HTTP_USER_AGENT} ^Website\ eXtractor [OR]
RewriteCond %{HTTP_USER_AGENT} ^Website\ Quester [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebStripper [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebWhacker [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebZIP [OR]
RewriteCond %{HTTP_USER_AGENT} ^Wget [OR]
RewriteCond %{HTTP_USER_AGENT} ^Widow [OR]
RewriteCond %{HTTP_USER_AGENT} ^WWWOFFLE [OR]
RewriteCond %{HTTP_USER_AGENT} ^Xaldon\ WebSpider [OR]
RewriteCond %{HTTP_USER_AGENT} ^Zeus
RewriteRule ^.* - [F,L]

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php80” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php80___lsphp .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
