1

I'm working on improving SEO for my website, and one of the ways I want to drive traffic to my site is by writing a blog.

Every post of my blog is saved to my sql database, then outputted on my website using PDO fetching, yada yada yada. It's nothing too complicated, just getting the content of each post from the database as a php variable and outputting it as text in html.

Once the content has been retrieved from the sql database, it looks something like this:

<div...>
    <p>$blog_content</p>
</div>

So, when it comes down to it, my blog is generated from just one file, called 'blog.php', and each post can be viewed individually by entering blog.php?id=X .

I've also used htaccess to create vanity urls as follows:

  • foo.com/blog/admin <-- Shows all posts by the user 'admin' (me)
  • foo.com/blog/admin/1 <-- Shows post with 'id' equal to '1'

Every post links to this second vanity url if you click on its title.

Here's the big question: As far as search engines are concerned, does my blog exist? Is google (and are other search engines) going to be able to find my blog, both in /blog/admin (where every post is listed and can be scrolled through) and in the individual pages (Example: post1 -> foo.com/blog/admin/1)? In other words, if I search for the exact contents of my blog post, will it show up in a search engine in either of these vanity pages -- and if so, how long will it be before it shows up?

  • Are you linking to each post from somewhere? Many sites including this one are database driven. It certainly can work, but it isn't enough just to make the pages available, you also have to link to them. – Stephen Ostermiller Jul 4 '17 at 9:35
  • @StephenOstermiller Thanks for the reply. I have a link in the menu bar that goes to my blog (/blog/admin), and then every entry that is loaded there is loaded with a link to its standalone vanity url (/blog/admin/1, /blog/admin/2, etc.). Of course, this is all still the same page/file in reality (blog.php). Does this mean that since /blog/admin is 'hardlinked' (so to speak), that search engines will beable to find it, and then find the database-driven links through it? – Carrot Slat Jul 4 '17 at 9:49
1

As long as you have links (internal or external) pointing to the (vanity) URLs, they should be found by Google. Keep in mind that a page that nobody links to, nor is available in your sitemap is highly unlikely to ever be found.

To answer a question you might be having right now: in all likelihood Google will not be randomly incrementing your post numbers like foo.com/blog/admin/2, foo.com/blog/admin/3 after it somehow landed on foo.com/blog/admin/1 in order to look for additional content.

You would, however, also need some validation (most often in the form of external links) to motivate Google to start crawling your website. Alternatively, you can use Google Search Console to manually have Google index your pages.

  • Thanks, I'll be sure to do a run-through with Search Console when the site's finished! – Carrot Slat Jul 5 '17 at 9:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.