Mobile app version of vmapp.org
Login or Join
Mendez628

: SEO links and ajax Only my main page shows up on a Google search on site:domain.com and I start to wonder why this happens. I also use Google Webmaster Tools which confirms this. On my main

@Mendez628

Posted in: #Ajax #Links #Seo

Only my main page shows up on a Google search on site:domain.com and I start to wonder why this happens. I also use Google Webmaster Tools which confirms this.

On my main page, I have these types of links

<a href="1234/some-nice-seo-text" onclick="loadPageWithAjax(1234); return false;">


The 1234 is the id of the page to load and the '/some-nice-seo-text'-appended is just a good description of the content of the page, which I hope the Google-bot will catch. The intended user will click the link and the same content will dynamically be loaded and shown. It seems like the Google-bot never follows these links - am I doing something wrong?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Mendez628

2 Comments

Sorted by latest first Latest Oldest Best

 

@Gonzalez347

I had a rewrite in my .htaccess file to change www.domain.com to domain.com. After changing the rewrite to work in the opposite way, that is, rewrite from domain.com to www.domain.com, it finally worked. I confirmed this using the Fetch as Google tool.

10% popularity Vote Up Vote Down


 

@Si4351233

You are using path relative URLs in your href attribute. The problem is that the actual link destination depends on the page where the link is.

An example:

<a href="testlink">Testlink</a>


When the link is at www.example.com, the link will be expanded to www.example.com/testlink.
However, when the link is at www.example.com/subpage, the link will be expanded to www.example.com/subpage/testlink.
In general, it is really easy to shoot oneself in the foot by using path relative URLs in links. By using / in the start of href attribute, you ensure that all URLs are domain relative.

Does Webmaster tools show any crawl errors?

You should also test your page links by right-clicking on the link on your page, copying link location and then browsing to that page in another window. This way you can see if the links work right.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme