Ajax driven website and google SEO [closed] - ajax

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
My problem is that Google doesn't index my website and it's been 5 weeks that the site is up and running.
It's not that it doesn't index my internal pages, it is that it does not index the website itself.
My website "ww.xyz.com" is just completely ignored when you type "xyz" as search keyword on Google.
The website is ajax driven and this is my configuration:
I have a robot.txt in the server root folder:
User-agent: *
Disallow: /admin/
Sitemap: http://www.xyz.com/sitemap.xml
I have a sitemap.xml in the server root folder:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="..." xmlns:xsi="..." xsi:schemaLocation="...">
<url><loc>http://www.xyz.com/</loc></url>
<url><loc>http://www.xyz.com/index.php?action=link1</loc></url>
<url><loc>http://www.xyz.com/index.php?action=link2</loc></url>
</urlset>
The index page looks like this:
<!doctype html>
<html lang="fr">
<head>
<title>xyz</title>
<meta http-equiv= "content-type" content="text/html;charset=utf-8">
<meta http-equiv= "Content-Language" content="fr" >
<meta name = "fragment" content="!">
<meta name = "google" content="notranslate">
<meta name = "robots" content="index,follow">
<meta name = "Description" content="...">
<meta name = "Keywords" content="...">
</head>
<body>
<ul id="menu>
<li id="mylink1">
Link 1
</li>
<li id="mylink2">
Link 2
</li>
</ul>
<div id="content">
<?php include('ajax.php');?>
</div>
</body>
</html>
The "ajax.php" file looks like this:
<script type="text/javascript">
$('#link1').click(function(e)
{
e.preventDefault();
$.ajax({
type:"POST",
url:"includes/page1.php,
data:"action=link1",
complete:function(data){$('#content').html(data.responseText);}
});
$('#link2').click(function(e)
{
e.preventDefault();
$.ajax({
type:"POST",
url:"includes/page2.php,
data:"action=link2",
complete:function(data){$('#content').html(data.responseText);}
});
});
</script>
Let's assume we are targeting "includes/page1.php", here is the page1.php content:
<?php
if($_POST['action']=='link1')
{
//show the content
...
}
?>
As you can see, the href url on the "index.php" are of no use as they are deactivated by the "e.preventDefault(); " inside the javascript.
It is the "$('#link1').click(function(e) {..})" that does all the job.
And as the #content is delivered dynamically by using "$('#content').html(data.responseText);", I believe there is a DOM issue that makes this website uncrawlable by the google bots.
I read this google help page which describes how to make ajax driven websites googles friendly:
https://developers.google.com/webmasters/ajax-crawling/docs/getting-started
The thing is they seem to explain how to make url's using hashes crawlable by google bots but my website doesn't use hashes within the links so I don't really get what I should do to make my website indexed by Google.
Any help would be appreciated.

You have two options:
Redo your website to use Google Crawlable Ajax Standard. But that's a bad idea.
Make your site without JavaScript being required. This is a good idea since it makes your site accessible to both search engines and humans alike. Remember, not everyone has JavaScript enabled. This is called Progressive Enhancement.

Related

YOURLS Short URL to Domain

Morning - I'd like to redirect my short url ie: https://sho.rt to my domain https://short.com
At the moment my sho.rt is pointing at the admin panel. Could you please advise as to how I'd redirect.
Thank you
You will need to build an index.php file that sits in the yourls top level directory. A simple example of how to redirect using html is.
<html>
<head>
<title>Your Site Title</title>
<script>
window.location.replace("https://www.yourwebsite.com");
</script>
</head>
<body>
<h2>If you are not automatically redirected in 5 seconds, Click Here</h2>
</body>
</html>

CKEditor Stylesheet Parser

I am working with CKEditor 4.4.5 and its plugin Stylesheet Parser 4.4, but I get empty list from the style drop-down.
To make my question easier to understand, please try this code (download from its example site: http://sdk.ckeditor.com/samples/styles.html):
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="robots" content="noindex, nofollow">
<title>Stylesheet Parser plugin</title>
<script src="http://cdn.ckeditor.com/4.5.2/standard-all/ckeditor.js"></script>
</head>
<body>
<textarea cols="80" id="editor2" name="editor2" rows="10" ><p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p>
</textarea>
<script>
CKEDITOR.replace( 'editor2', {
extraPlugins: 'stylesheetparser',
height: 300,
// Custom stylesheet for editor content.
contentsCss: [ 'http://sdk.ckeditor.com/samples/assets/stylesheetparser/stylesheetparser.css' ],
// Do not load the default Styles configuration.
stylesSet: []
} );
</script>
</body>
</html>
It doesn't really work. But the sample on that site works well.
I also find another sample site:
http://ckeditor.com/ckeditor_4.3_beta/samples/plugins/stylesheetparser/stylesheetparser.html
I tried to copy all the sources code from this demo site, but get no luck.
Did anyone else have the same problem?
How can I make the codes above work? It basically uses the source codes from CDN site so I don't think the version of source code matters.
You should try with this version: http://ckeditor.com/addon/stylesheetparser-fixed
The official plugin has some problems since very long ago but they don't seem to plan to fix them.
This problem is caused by Cross-domain request. The CSS file is in HTTP server, and my application is running with a port number. So they are treated as cross domain request.
I also tested the HTML page and CSS file in the local files. However, file://...path is still treated as Cross Domain request in Chrome, but FF and IE works with that properly though.
When I tried this in server, it works properly with Chrome. Unfortunately, there seems no way to make cross domain request work in Chrome and Firefox.

How can I have a dynamic image show when someone clicks the Facebook Like button and Posts to Facebook?

Currently, when someone 'likes' a link and creates a Facebook post (via the like button), it will only grab the one image that I specify in the meta tag (via the og:image property).
What is the best way to allow people to post a dynamic image with dynamic description? In my case, I have several items (with image & description) listed on a page that the user should be able to 'like' and post on their wall. Any advice would be much appreciated.
Thanks!
Change the meta tag on click: use this example and modify it to your needs.
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<title>Title Of Page</title>
</head>
<body>
<input type="button" value="Click Me" onclick='$("title").html("Changed Dynamically");'/>
</body>
</html>

What's so spammy about this email? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I'm building out an email receipt that goes back to a user after they register for an upcoming event on one of our sites, but gmail is consistently sending it to the spam folder. I've isolated the issue to the body content of this html email:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Zzzzzzz Online PATHe Registration</title>
</head>
<body>
<p>Dear <?php echo $data['f_name']; ?>,</p>
<p>
Thank you for registering for our upcoming open house. We will be in
touch shortly to arrange a meeting time on <?php echo $data['date'];?>.
</p>
<p>
The open house will be given at our Zzzzzzz Avenue Campus located at
175 Zzzzzzz Ave, Zzzzzzz AL.
Look up directions on <a href="<?php echo $gmaps;?>" target="_blank">
Google Maps</a> or Mapquest.
</p>
<p>We look forward to meeting you,</p>
<p>
Zzzzzzz College Online<br/>
info#zzzzzzz.edu<br/>
(877)772-2265
</p>
</body>
</html>
I've tried these things:
Html with doctype that fully validates
Replaced shortened urls for map sites with full length urls
Tried email without any urls at all
So all I can think of is the language being used, but this is a perfectly valid response. A user who fills out this form is asking the college to contact them to set up a meeting for dates that they select. What am I missing here??
EDIT: the following content passes the spam test just fine. Ironically we started with this but rewrote it because it's too generic and does not give the user actionable information about the location of the open house:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Zzzzzz Online Open House Registration</title>
</head>
<body>
<p>Dear Micah,</p>
<p>Thank you for registering for our upcoming open house. We will be in touch
shortly to arrange a time and to answer any questions you may have.</p>
<p>For directions and more information, please visit out open house page at
http://online.zzzzzzz.edu/open-house. In the meantime, if you have any
questions or concerns that come up between now and the open house please feel
free to contact us.</p>
<p>We look forward to meeting you,</p>
<p>Zzzzzz College Online</p>
</body>
</html>
I am not an expert in this field, but a quick Google search of the error you are receiving says that you should include both a text/html MIME type and a text/plain MIME type, as normal e-mails will contain both, while SPAM usually only contains the text/html version.

mod_rewrite external links issue (wordpress)

i have a redirect.php and a link and it doesn't work in WORDPRESS.
i expect when i click the "hello" link on my site, it goes to redirect.php, the user sees the spinner for 5 secs, and the users exits my site to hello.com
it looks like there is something wrong with mod_rewrite i'm unable to solve
i'd really appreciate a very detailed answers. i am very junior
this what i have.
1.- I have an external link in my homepage:
Hello
2.- In redirect.php, i have:
<html>
<head>
...
<meta http-equiv="refresh" content="5;url=<?php echo $_GET['link'];?>" />
...
</head>
<body>
<h1>You are leaving my site!</h1>
<img src="/images/spinner.gif" alt="spinner" />
</body>
</html>
The link <a href="http://redirect.php?... is incorrect. This should most likely be <a href="/redirect.php?... or any subdirectory on your server.
You should also include the protocol in your link parameter or prepend it in your meta tag. Also make sure to HTML encode the link in your meta tag and to properly URL encode the domain name in your link parameter.
So, change the link to:
Hello
if you have the redirect.php file in the root of your website. And change the meta tag to:
<meta http-equiv="refresh" content="5;url=<?php echo htmlentities($_GET['link'], ENT_QUOTES,);?>" />
And you might want to do some validation on the validity of the link parameter and you possibly also want to check the referrer URL ($_SERVER('HTTP_REFERER')) to make sure you only perform redirects for links from your own website (i.e. don't create an open redirect vulnerability).

Resources