为我的sitemap.xml重写规则.htaccess

Dom*_*nik 3 .htaccess mod-rewrite url-rewriting url-rewrite-module

我安装了一个内容管理系统插件,在http://www.domain.com/index.php?eID=dd_googlesitemap下为Google提供了一个站点地图,如何在我的.htaccess中添加重写规则,以便在http://www.domain.com/sitemap.xml而不是?

Jus*_*man 6

您可以将此代码添加到您的htaccess文件(必须位于根文件夹中)

RewriteEngine On
RewriteRule ^sitemap\.xml$ /index.php?eID=dd_googlesitemap [L]
Run Code Online (Sandbox Code Playgroud)

确保mod_rewrite已启用