#ErrorDocument 503 /error503.html

### Begin permalinks -- do not edit this section!
<IfModule mod_rewrite.c>
	RewriteEngine On
	DirectorySlash Off
	Options -Multiviews
	
    ErrorDocument 404 /error404.html
    
#    RewriteCond %{HTTP_HOST} ^tools\.seoezypro\.com$ [NC]
#    RewriteRule ^admin/?$ https://seoezypro.com/myaccount/sso_login [R=301,L]    

    # Rule 1: Remove query string id=value while preserving the path
    RewriteCond %{QUERY_STRING} ^id=([a-zA-Z0-9_-]+)$
    RewriteRule ^([a-zA-Z0-9_-]+)$ /$1? [R=301,L]
    
    # Rule 2: Remove trailing slash while preserving the path
#    RewriteCond %{REQUEST_URI} ^/(.+)/$
#    RewriteRule ^(.+)/$ /$1 [R=301,L]

	RewriteRule ^tools$ tools.php [NC,L,QSA]
#	RewriteRule ^tools/(.+)$ tool.php?id=$1 [NC,L,QSA]
	RewriteRule ^tools/(.+)$ tool.php [NC,L,QSA]
	RewriteRule ^account$ account/index.php [NC,L,QSA]

	### login sso to seoezypro.com
#	RewriteRule ^account/login$ account/login.php [NC,L,QSA]
	RewriteRule ^account/login$ https://seoezypro.com/en/myaccount/sso_login [NC,L,QSA]
	RewriteRule ^account/sso-login$ account/sso-login.php [NC,L,QSA]	

	RewriteRule ^account/register$ account/register.php [NC,L,QSA]
	RewriteRule ^account/password\-reset$ account/password-reset.php [NC,L,QSA]
	RewriteRule ^account/confirm$ account/confirm.php [NC,L,QSA]
	RewriteRule ^account/websites$ account/websites.php [NC,L,QSA]
	RewriteRule ^account/settings$ account/settings.php [NC,L,QSA]
	RewriteRule ^account/signout$ account/signout.php [NC,L,QSA]
	RewriteRule ^contact$ contact.php [NC,L,QSA]
	RewriteRule ^embed$ embed.php [NC,L,QSA]
	RewriteRule ^terms$ terms.php [NC,L,QSA]
	RewriteRule ^privacy$ privacy.php [NC,L,QSA]
	RewriteRule ^pricing$ pricing.php [NC,L,QSA]
	RewriteRule ^bing\-serp$ tool.php?id=bing-serp [NC,L,QSA]
	RewriteRule ^domain\-authority$ tool.php?id=domain-authority [NC,L,QSA]
	RewriteRule ^page\-authority$ tool.php?id=page-authority [NC,L,QSA]
	RewriteRule ^competition$ tool.php?id=competition [NC,L,QSA]
	RewriteRule ^crawlability$ tool.php?id=crawlability [NC,L,QSA]
	RewriteRule ^extract\-meta\-tags$ tool.php?id=extract-meta-tags [NC,L,QSA]
	RewriteRule ^google\-serp$ tool.php?id=google-serp [NC,L,QSA]
	RewriteRule ^headers$ tool.php?id=headers [NC,L,QSA]
	RewriteRule ^high\-quality\-backlinks$ tool.php?id=high-quality-backlinks [NC,L,QSA]
	RewriteRule ^indexed\-pages$ tool.php?id=indexed-pages [NC,L,QSA]
	RewriteRule ^keyword\-density$ tool.php?id=keyword-density [NC,L,QSA]
	RewriteRule ^keyword\-research$ tool.php?id=keyword-research [NC,L,QSA]
	RewriteRule ^link\-analysis$ tool.php?id=link-analysis [NC,L,QSA]
	RewriteRule ^mobile\-support$ tool.php?id=mobile-support [NC,L,QSA]
	RewriteRule ^new\-backlinks$ tool.php?id=new-backlinks [NC,L,QSA]
	RewriteRule ^poor\-backlinks$ tool.php?id=poor-backlinks [NC,L,QSA]
	RewriteRule ^robots\-txt$ tool.php?id=robots-txt [NC,L,QSA]
	RewriteRule ^sitemap$ tool.php?id=sitemap [NC,L,QSA]
	RewriteRule ^speed\-test$ tool.php?id=speed-test [NC,L,QSA]
	RewriteRule ^submit\-sitemap$ tool.php?id=submit-sitemap [NC,L,QSA]
	RewriteRule ^top\-referrers$ tool.php?id=top-referrers [NC,L,QSA]
	RewriteRule ^top\-search\-queries$ tool.php?id=top-search-queries [NC,L,QSA]

	# Fix for directory slashes
	<IfModule mod_authz_core.c>
		RewriteOptions AllowNoSlash

		RewriteCond %{REQUEST_FILENAME} -d
		RewriteCond %{REQUEST_URI} ^(.+[^/])$
		RewriteRule ^ %1/ [R,L,QSA]
	</IfModule>
</IfModule>
### End permalinks
