Why doesn't Google recognise my PHP-generated sitemap.xml file? - seo

I'm generating a simple XML sitemap with PHP and use a .htaccess rewrite the 'turn' that file into a .xml file. When I try to submit it to Google, Google gives me an non-descriptive error that I can't load the sitemap.
Here's the file: https://www.densediscovery.com/feed/sitemap/sitemap.xml
Does anyone have any ideas why it's not accepting it? Any other ideas for generating one (with PHP) that is acceptable?

This is probably because your webserver doesn't recognize .xml as an extension of files that should contain PHP code.

Google is not working like that, you just point to an XML file. (Not a file that changed the name to look like XML).
You need a PHP that generate a file let's say myXML.xml
How to generate XML file dynamically using PHP?
Then you add the URL of myXML.xml in Google.
If it looks too complicated you can use any online tool to generate a sitemap

Related

Parsing MT4 config files

I'm trying to write an install script for an MT4 expert advisor. Part of the installation process includes adding an allowed WebRequest URL. I assume this is saved as a setting in C:\Users\{User ID}\AppData\Roaming\MetaQuotes\Terminal\{Terminal ID}\config\experts.ini as I can see the allowed URLs there, but I cannot parse this data as no editor I have can decode it. Is this file parsed using a proprietary encoding or is it encrypted in some way? Any help here would be appreciated.

Make Indexed File Downloadable In Apache Solr

I am trying to indexed pdf file to Solr which I have done successfully using the command
curl "http://localhost:8983/solr/update/extract?literal.id=id=true"-F myfile=#filename.pdf"
I am able to see the file contents and search, but when I try to click on file name it shows
HTTP ERROR 404
Problem accessing /solr/collection1/id. Reason:
not found
What I want is to have a link which allows downloading the file, I know Solr merely indexes the file and stores it. I was wondering if there is a way by which I can add attribute location like you have done and proceed from there, can you please share with me what you have done, if you want any more clarity regarding my problem do ask.
We have the actual files hosted through a separate web application to be download from with auditing and additional security.
you can always directly host these files through http server.
If you are having the file names with id, it is as easy as appending the id.extension to the fixed http hosted url.
Else index the path of the file with an additional parameter e.g. literal.url.
The url will the solr field which will now be available with the Solr response.

How to optimize wordpress website and Db properly?

I am using wp-minify and css and scripts file aggregation plugin for website optimization.
Can anybody answer the following
Which plugin is considered good for Database optimization?
How to add expiry headers to javascripts,images and stylesheet?
Which plugin is good for enabling cache for website's better performance?
There are several plugins that helps to create a cache and instead of fetching content from the database the content is loaded from the cache i.e. html version.
Moreover, you need to follow the few SEO guidelines that I have mentioned below to optimize your wordpress website for search engine like Google.
http://wordpress-tuts.blogspot.com/2017/05/best-ways-to-optimize-and-boost-seo-of.html
For expiry headers you can modify the .htaccess file in your website root folder. You can set the expiry time for all files in said root.
Here is a simple guide:
http://softstribe.com/wordpress/how-to-add-expires-headers-in-wordpress/

Sitefinity: Need to make a PDF available on a very specific URL but can't do it

I have a website on SiteFinity 4.4. I need to make a document available on a very specific URL, i.e.
http:www.example.com/reports/the-report.pdf
If I just create a directory in the root of the site it does not work (503 error). Also when I try to use the 302Redirect.xml file to redirect the URL to the PDF it does not work either (same error). The link has already been published and has to be exactly as specified. How do I solve this?
Any help would be greatly appreciated.
Sitefinity wouldn't block a folder. Adding a physical folder and dropping that report on the proper place should function, so it probably means you'll have to check your server configuration.
Anyway, the fastest way outside Sitefinity, would be to just create a IIS rewrite rule. Make the http:/www.example.com/reports/the-report.pdf the pattern and redirect them to the url of the document from the sitefinity library.
When you upload a document to the library in sitefinity it gives you an direct url, something like /docs/defaultlibrary/document. You can verify the url by going to content >> documents and files and chose Embed link to this file. That gives you a pop-up with the url.

How to use relative URL's in website with two base URL's

I have our basic corporate static html website installed in our web root directory and our billing software installed in /portal. I have integrated the websites to look like a single site by including the /menu.tpl smarty template file in the /portal/header.tpl file. However, if I use relative URL's, the menu sysem doesnt work as the base url for the billing script is /portal. i.e. if I create a link to faq.php in the menu.tpl and I load a page on the portal site, the link in the menu back to the faq page is now /portal/faq.php whereby if I load a page off the root site the link is just /faq.php as it should be.
The obvious answer is to just use absolute URL's, but I need the site to be portable as I have many developers who need to install and test it.
I cant find anyway to resolve this. Any ideas?
I ran into the same problem as you a while ago, and after trying a lot of dead ends, I finally ended up with the following solution:
For any URL you need to be a chamelion, i.e. change its path depending on the environment, insert a PHP function that writes out the correct URL.
If you include the PHP function from a single central file, then you can change all of the URL's in the entire site automatically, based on a setting, or some pre-detected switch such as the current domain name, etc.
Example:
<?php print_base_url_plus("/menu.php"); ?>
... where print_base_url_plus() is a function which appends the base URL onto the output.
You may find that you have to change some of the URL's to be php, so they are preprocessed by the PHP engine, or, you can alter the web settings so that standard .htm files are piped through the PHP engine, just like .php files.