HTACCESS Issue : Sitemap.xml giving error when access

Discussion in 'Apache' started by seomanualsubmission, May 15, 2020.

  1. #1
    Server : Shared Bigrock
    Trying to Rewrite sitemap.php to sitemap.xml
    But when going to access https://www.indiaztour.com/sitemap.xml (Showing blank in firefox and HTTP ERROR 500 in chrome).

    Note : Working fine on local server (xampp).

    My HTACCESS Code is as below

    Options +FollowSymLinks -MultiViews
    RewriteEngine on
    # ensure www.
    RewriteCond %{HTTP_HOST} !^www\. [NC]
    RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    # ensure https
    RewriteCond %{HTTP:X-Forwarded-Proto} !https
    RewriteCond %{HTTPS} off
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    RewriteRule places-(.*)\.php$ places.php?page=$1 [NC,L]
    RewriteRule blog-(.*)\.php$ blog.php?page=$1 [NC,L]
    Rewriterule sitemap.xml$ sitemap.php [L]
    Rewriterule sitemap1.xml$ sitemap1.php [L]
    Rewriterule sitemap2.xml$ sitemap2.php [L]
    Code (markup):
    I am using same code to one of our website at VPS and working fine but not at shared server. Please guide me that what i am missing here.

    I am trying to find error and put code also at sitemap.php
    error_reporting(E_ALL);
    ini_set('display_errors', 1);
    header('Content-Type: text/xml');
    
    PHP:
    But seems like its not entering to page ..... because showing either blank page or 500 error only.
     
    Last edited: May 15, 2020
    seomanualsubmission, May 15, 2020 IP