broken header on load sitemap.xml for google search - sitemap

sitemap.xml not work in my host:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://tcg-wallet.ga/</loc>
<lastmod>2022-12-13T17:12:22+00:00</lastmod>
</url>
</urlset>
located in public, and loaded via: https://tcg-wallet.ga/sitemap.xml
in network i see this:
but when i try to get it working in google search i get this:
i have test it with: https://www.xml-sitemaps.com/ and get this:
i have try handle the content type with .htaccess but is not enough to solve the problem:
<IfModule mod_expires.c>
AddType application/xml xml
</IfModule>
I can't find that it is misconfigured.***

Related

http-server: How to disable charset for .wasm files?

I am running a https server (Apache?) on my Mac. Done by this hints:
https://medium.com/#jonsamp/how-to-set-up-https-on-localhost-for-macos-b597bcf935ee
It serves my wasm-files with charset and I get: TypeError: WebAssembly: Response has unsupported MIME type 'application/wasm; charset=utf-8' expected 'application/wasm'
Changing .htaccess by adding
AddType 'application/wasm' .wasm
does not help. It feels like the server ignores .htaccess

Sitemap is redirecting to non secure site

We have a multilang site and used a sitemap for each lang. Then we used a sitemapindex where we have a mapping of sitemaps avaliable :
<sitemap>
<loc>https://example.com/sitemap_en.xml</loc>
<lastmod>2018-07-10</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap_fr.xml</loc>
<lastmod>2018-07-10</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap_nl.xml</loc>
<lastmod>2018-07-10</lastmod>
</sitemap>
</sitemapindex>
The sitemap is working ok and valids. However when I pass the console of google and launch the reading of sitemap for indexing, I have a 301 redirect from https to http. That is not happening when I type the url of my site , and i have a rule in my htaccess for avoid this :
RewriteCond %{HTTPS} !on
RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Somebody have some idea why when google tries to index the site it gets a redirection from https to http ?

mod_rewrite - redirect to a different url based on existence of x_wap_profile header

We have a desktop and a mobile version of our webapp.
The desktop url is more prominent and so we would like to redirect the user to the mobile version in case the request is for the desktop url from a mobile device.
In the apache config we have the mod_rewrite module
and my config at present looks like this
<IfModule mod_rewrite>
RewriteEngine On
RewriteCond %{x-wap-profile} ^https?://
RewriteRule ^/(.*) http://google.com [L,R]
</IfModule>
At this point this is the only rewrite rule that we have so I'm not sure if L is required because this is the first and last rule anyway.
I have just indicated redirection to google.com for testing purposes
I'm not sure if my condition check is right.I couldn't figure out how to check for existence of a header.Is that what is wrong?If yes,please let me know how to specify the RewriteCond
How I'm Testing?
I'm testing from a Firefox browser and using the Modify headers plugin to simulate the mobile request.I'm adding the x_wap_profile header.
However I don't see any redirect happening with this config.Can you please let me know where I'm going wrong?I would also appreciate if there is any logging that can be introduced here to verify if this rule is being trigerred.I don't see any errors though with the current modified config.
To check for an arbitrary header in mod_rewrite (i.e. a header not in this list), the syntax is:
RewriteCond %{HTTP:x-wap-profile}
This one seems to work:
RewriteEngine On
RewriteCond %{HTTP:x-wap-profile} ^.+
RewriteRule .* http://google.com [L,R]
piotrek#piotrek-Vostro-2520:~/vhosts/localhost$ curl http://localhost/
OKOK
piotrek#piotrek-Vostro-2520:~/vhosts/localhost$ curl -H 'x-wap-profile: abcd' http://localhost/
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved here.</p>
<hr>
<address>Apache/2.4.6 (Ubuntu) Server at localhost Port 80</address>
</body></html>
Change it to make it work for https inside header.
Docs here: http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritecond in section Other things you should be aware of:.

Using Apache as a ruby server

Is there any way I can use Apache as a ruby server ?
You may want to consider the 'Passenger' module, see the website. Yesterday I installed this module using their instructions on the website and it went well.
I did it via gem install passenger. I have not deployed anything as yet. Good luck with whatever option you choose.
Use eruby and libapache2-mod-ruby packages then activate the ruby module with sudo a2enmod ruby.
Don't forget to create a configuration file /etc/apache/conf.d/ruby.conf and put something in here, like :
AddType text/html .rhtml
AddType text/html .rbx
DirectoryIndex index.rhtml index.rbx
<IfModule mod_ruby.c>
RubyRequire apache/ruby-run
RubyRequire apache/eruby-run
<Files *.rbx>
Options +ExecCGI
setHandler ruby-object
rubyHandler Apache::RubyRun.instance
</Files>
<Files *.rhtml>
setHandler ruby-object
rubyHandler Apache::ERubyRun.instance
</Files>
</IfModule>

google site map not working since pretty codeigniter urls

Okay, what is happening!? I switched to pretty urls using code igniter; http://robertwaynehq.com/what-we-do rather than the same with .php
I then updated the site map file and it doesn't seem to like that the pages have no extension. Further the google webmaster site is giving a redirect error. Yet the pages work. Help?
Edit: I do have the redirects in the old files.
<?php
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://mydomain.com/what-we-do" );
?>
The real issue is that I have updated the sitemap.xml and google webmaster tools doesn't seem to like or recognize the files.
<?xml version="1.0" encoding="UTF-8"?>
<urlset>
<url>
<loc>http://mydomain.com/</loc>
<changefreq>weekly</changefreq>
</url>
<url>
<loc>http://mydomain.com/index.php</loc>
<changefreq>weekly</changefreq>
</url>
<url>
<loc>http://mydomain.com/what-we-do</loc>
<changefreq>weekly</changefreq>
</url>
<!-- and so on for each page... -->
</urlset>
set 301 redirect in the old php files, redirecting to the url of the page
Google Webmaster Tools help on 301 Redirect
301 Redirect in PHP

Resources