S
S
shatamba2013-12-10 21:01:25
PHP
shatamba, 2013-12-10 21:01:25

How to optimize PHP script for generating META ROBOTS tags?

Just want to warn you, I'm not a developer and have only basic PHP skills.
Recently, to optimize my workflow, I wrote a script to manage the ROBOTS meta tag and rel="Canonical" (a tag for managing indexing by search engines)
More about META ROBOTS Script
logic:
1. Include the script in the head
2. Create the metarobots.txt control file, write it contains control commands according to a standard similar to robots.txt in the form of regulatory expressions.
3. The script recognizes the entries in the control file and puts down the necessary tags.
More about the script
I think the essence is clear, and now the questions:
1. Need help in optimizing the script, although I'm not a developer, it seems to me that it would be possible to implement the logic of the Canonical team more universally. Now it is possible to set canonical pages based on the current URL and, frankly, I have come to a dead end inventing the logic of the rules for setting Canonical.
2. Need help in testing the script, and, if possible, an indication of possible errors in the logic.
3. What additional functions do you think could be useful in such a script?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
Nikolai Vasilchuk, 2013-12-10
@Anonym

This is what happens when a SEO climbs programming.

S
Sergey, 2013-12-10
Protko @Fesor

contact freelancers. The answer to your question does not bring any benefit and only helps to solve your particular problem. It's actually a bit sad that the questions here don't have a rating...

I
InDiGo2010, 2013-12-15
@InDiGo2010

why this crap with connecting files? function with conditions and connect in head.
$base_php = basename($_SERVER['SCRIPT_FILENAME']);
if ($base_php == 'filename.php')
echo "\n";

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question