2 προβολές

How to Setup nginx for Yoast, SEO Framework, All In One SEO

[et_pb_section fb_built=”1″ _builder_version=”3.0.47″][et_pb_row _builder_version=”3.0.47″ background_size=”initial” background_position=”top_left” background_repeat=”repeat”][et_pb_column type=”4_4″ _builder_version=”3.0.47″ parallax=”off” parallax_method=”on”][et_pb_text _builder_version=”3.0.47″ background_size=”initial” background_position=”top_left” background_repeat=”repeat”]

For Yoast SEO

[/et_pb_text][et_pb_text _builder_version=”3.0.101″]

Basic Code

# Rewrites for Yoast SEO XML Sitemap
 rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last;
 rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;

 

Expanded Code

 

#Yoast SEO Sitemaps
location ~ ([^/]*)sitemap(.*).x(m|s)l$ {
## this rewrites sitemap.xml to /sitemap_index.xml
rewrite ^/sitemap.xml$ /sitemap_index.xml permanent;
## this makes the XML sitemaps work
rewrite ^/([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 last;
rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
## The following lines are optional for the premium extensions
## News SEO
rewrite ^/news-sitemap.xml$ /index.php?sitemap=wpseo_news last;
## Local SEO
rewrite ^/locations.kml$ /index.php?sitemap=wpseo_local_kml last;
rewrite ^/geo-sitemap.xml$ /index.php?sitemap=wpseo_local last;
## Video SEO
rewrite ^/video-sitemap.xsl$ /index.php?xsl=video last;
}
[/et_pb_text][/et_pb_column][/et_pb_row][et_pb_row _builder_version=”3.0.47″ background_size=”initial” background_position=”top_left” background_repeat=”repeat”][et_pb_column type=”4_4″ _builder_version=”3.0.47″ parallax=”off” parallax_method=”on”][et_pb_text _builder_version=”3.0.47″ background_size=”initial” background_position=”top_left” background_repeat=”repeat”]

All in One SEO

[/et_pb_text][et_pb_text _builder_version=”3.0.101″ background_size=”initial” background_position=”top_left” background_repeat=”repeat”].htaccess

#All in one SEO sitemap.xml

#RewriteEngine On
#RewriteBase /
RewriteRule ^sitemap.xml$ /index.php?aiosp_sitemap_path=root [L] RewriteRule ^sitemap_(.+)_(\d+).xml$ /index.php?aiosp_sitemap_path=$1&aiosp_sitemap_page=$2 [L] RewriteRule ^sitemap_(.+).xml$ /index.php?aiosp_sitemap_path=$1 [L][/et_pb_text][et_pb_text _builder_version=”3.0.101″ background_size=”initial” background_position=”top_left” background_repeat=”repeat”]

nginx

 

#All in one SEO sitemap.xml

#RewriteEngine On
#RewriteBase /
RewriteRule ^sitemap.xml$ /index.php?aiosp_sitemap_path=root [L] RewriteRule ^sitemap_(.+)_(\d+).xml$ /index.php?aiosp_sitemap_path=$1&aiosp_sitemap_page=$2 [L] RewriteRule ^sitemap_(.+).xml$ /index.php?aiosp_sitemap_path=$1 [L] [/et_pb_text][et_pb_text _builder_version=”3.0.47″ background_size=”initial” background_position=”top_left” background_repeat=”repeat”]

SEO Framework

[/et_pb_text][et_pb_text _builder_version=”3.0.101″ background_size=”initial” background_position=”top_left” background_repeat=”repeat”]
rewrite ^/sitemap\.xml$ /index.php?the_seo_framework_sitemap=xml last;
rewrite ^/sitemap\.xsl$ /index.php?the_seo_framework_sitemap=xsl last;
[/et_pb_text][/et_pb_column][/et_pb_row][/et_pb_section]

Μοδάτα άρθρα