Cake PHP - XML站点地图文件夹问题

时间:2017-05-25 14:43:42

标签: php xml .htaccess cakephp cakephp-2.0

我们正在使用国际SEO策略,
当用户来自美国时,他将登陆美国网页(www.example.com/us-en),如果用户来自英国,他将登陆英国网页(www.example.com/gb-en)< / p>

现在我们需要在www.example.com/us-en/sitemap.xml文件夹上上传站点地图 当我们尝试打开此网址(www.example.com/us-en/sitemap.xml)时,它工作正常,但问题是当我们尝试打开时(www.example.com/us-en/)它是显示文件夹中的所有文件,但实际上我们只需要显示网页而不是文件。

我在特定国家/地区重定向所有网址的第一个密钥 如果用户来自美国

Router::connect(
'/:country',
array('controller' => 'Home', 'action' => 'index'),
array(

     'pass' => array('country')

)); 

的.htaccess

<IfModule mod_rewrite.c>
    RewriteEngine on
    # Uncomment if you have a .well-known directory in the root folder, e.g. for the Let's Encrypt challenge
    # https://tools.ietf.org/html/rfc5785
    #RewriteRule ^(\.well-known/.*)$ $1 [L]
    RewriteRule ^$ app/webroot/ [L]
    RewriteRule (.*) app/webroot/$1 [L]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !server-status
    RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>

0 个答案:

没有答案