How can I get search engines to index dynamically generated pages [closed] - php

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 trying to create a blog ..and for every entry I have a template page called entry.php
I create the pages by creating a link from my home page like this
mywebsite.com/entry.php?title=My Title&content=This is my blog
This link is passed to entry.php and a page is generated on the fly based on the link i wrote but search engines wont index these.
Do I really have to create a unique page for every entry I create?
Do sites like youtube have individual pages for every single video or are they generated dynamically like im trying to do. If so how do the videos show up in search results?
Ive heard something called .htaccess or sitemap.xml can be used for this I have no idea what these are though.

Learn about .htaccess
There are a lot of generators for .htaccess and you can use one of them. The best thing to do is, using a .htaccess file, create the paths this way:
mywebsite.com/entry.php?title=My Title&content=This is my blog
Change them to:
mywebsite.com/My Title/This is my blog
And the code for the same is:
RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)\.html$ /entry.php?title=$1&content=$2 [L]
Websites offering generators:
.htaccess redirect
Mod Rewrite Generator
Search Engine Optimization Tools » mod_rewrite rewriterule generator

As long as the page is linked to from somewhere, search engines will find the page. It does not matter how the page is generated. A link is a URL, when requesting this URL the browser or any other client (including search engines) receive the page content, period. It works like any other regular page, search engines don't know or care what happens behind the scenes to generate this page.

Related

How do I protect individual wordpress urls from being attacked? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I am trying to secure my WordPress site from hackers - more specifically, individual non-content pages that appear to be getting more hits. I am using Siteground and installed WordPress a few months ago. Checking the website statistics I was taken aback by what I saw. I have briefly summarised the page hits below.
https:// ... /wp-admin/admin-ajax.php --> this page has been viewed over 16k times each month. Considering my site has been live for only 2 months, contains no SEO, and no-one knows about its existence this is odd!
https:// ... /index.php/wp-json/wp/v2/users/ --> this page is giving away my usernames.
https:// ... /index.php/wp-json/wp/v2/pages --> appears to display code from one of my main pages.
And a whole load of pages that appear very odd to be accessing:
https:// ... /index.php/wp-json/wp/v2/taxonomies
https:// ... /index.php/wp-json/wp/v2/categories
https:// ... /index.php/wp-json/wp/v2/taxonomies/post_tag
https:// ... /index.php/wp-json/wp/v2/taxonomies/category
https:// ... /index.php/wp-json/wp/v2/tags
https:// ... /wp-admin/load-styles.php --> shows blank screen
There's a whole load more, some redirects to the WordPress login page and others show a blank screen. There's also some URLs that allow any user to download a *.woff file (whatever that is?!).
Point is, I thought WordPress would be secure enough to not let these pages appear visible and show details at the very least.
Is there anything I can do? As I pointed out, I'm using Siteground which doesn't use cPanel.
I thought the most difficult part of a blog site is the content creation and overall web design. I'm not sure now.
Any help and/or advice would be greatly appreciated.
Thank you.
As for accessing login pages, that's to be expected with a WordPress site - bots love them.
You should have a strong password and use a nonstandard username for your admin-rights accounts. Bots will always access the default page with default login credentials to try it out. You could go another step and move the login page, too, that will massively drop accesses to the real login page, there's a plugin for it if you aren't comfortable coding that yourself: WPS Hide Login.
As for the wp-json URLs, you can ensure they are requiring logins / disabled with answers provided here, such as a plugin that disables it: Disable REST API.
Concerning the .woff files, those are just font files, either a bot scrapes over them or a user is accessing them to view the web page as it was designed; not a concern really.
WordPress has a decent article on additional things you can do to secure your website as well here.

how google crawls dynamic pages? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am about to create an Online Shopping site for my one of the client. I have to make this site SEO Friendly and therefore I must have to understand few things before I proceed to make a custom CMS Based website.
As I said I am going to make a Custom CMS Based website so that my client will be able to add new content through CMS but I don't understand few things.
For Example: I have an index.php page which has many links to different products and all of these links are created through Database using PHP. Site Link like
http://www.def.com/shoes/Men-Shoes
My Questions:
1) I want to know that when the GoogleBot crawls my site, will it also open my dynamically created links and index them? Will GoogleBot also index the content of my dynamic links?
2) Do I have to create seperate pages for all of the products on site and store them on my server? Or just a single page which serves dynamically according to user query for every product?
I read this
"It functions much like your web browser, by sending a request to a web server for a web page, downloading the entire page, then handing it off to Google’s indexer."
is it right?
my above query was actually looking like this and I used .htaccess file to make it pretty
http://www.def.com/shoes.php?type=Men-Shoes
so is it right and google will crawl it to index?
SEO is a complex science in itself and Google is always changing the goal posts and modifying their algorithm.
While you don't need to create separate pages for each product, creating friendly URL's using the .htaccess file can make them look better and easier to navigate. Also creating a site map and submitting this to Google Via their webmaster tools will help them to know which pages to index.
GoogleBot will follow the links in your site, including dynamically created one, but it is important not to try and game the system using Blackhat methods if long term success is your aim.
Also, use social media (Twitter, Facebook, Google+) to help promote your brand and make sure you follow Google's guidelines with regards to SEO and inpage optimisation.
There is a huge amount of information on the internet on this subject, but be careful what advice you follow.
Google and other search engines index the dynamic links too. So a way to avoid duplicate content is to use the "Crawl"->"URL Parameters" tool in Google Webmasters. You can read more about how that works here https://support.google.com/webmasters/answer/6080548?rd=1. Set "Crawl" field to "No URLs". By this way you could hide from search dynamic links but you have to have a list of all of your dynamic links of your website/CMS in order not to hide important content accidentally. The "URL Parameters" feature is available in Bing Webmaster tools also http://searchenginewatch.com/sew/how-to/2195777/bing-webmaster-tools-an-overview#.

SEO - Pretty URLs and Dynamic URLs at the same time [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
I was wondering if a site using both pretty urls and dynamic urls will be penalized for duplicate content.
Let's say
http://example.com/article/1 is the same as http://example.com/?article=1. Is this bad for SEO?
Extra question:
Entering http://example.com/?blabla=qwerty will load the default home page. Is http://example.com/?blabla=qwerty treated as different page than http://example.com ?
What happens if the user enters http://example.com/????article=1, is it different than http://example.com/?article=1? Thanks
Forget end users - if search engine bot can index both the pages then it's bad SEO.
Let's say if Google is indexing http://example.com/article/1 as well as http://example.com/?article=1 then it will be treated as duplicate content on same site.
However http://example.com/?blabla=qwerty and http://example.com and all such variations are treated as a single page.
So it's not bad for SEO, but definitely not a good strategy. Best practice is to redirect http://example.com/?article=1 to http://example.com/article/1.
http://example.com/article/1 and http://example.com/?article=1 is treated as two different URLs to a search engine. They are bad for SEO because of the following reasons:
link juice is split between the 2 URLs
duplicate content on the same site as mentioned by Pavan.
As in 1, the same principle applies. http://example.com/?blabla=qwerty is indeed treated as a different page than http://example.com/
http://example.com/????article=1 is indeed different from http://example.com/?article=1. In the first case, the GET parameter is "???article" having a value of 1 and the second example, the GET parameter is "article" having a value of 1.
Now to solve this, you can use one of several strategies:
Use Canonical URLs
The Canonical URL serves to consolidate link signals for the duplicate or similar content. More to read on Google Webmaster Tools. In your case, you should add a canonical URL in the header such as.
<link rel="canonical" href="http://example.com/article/1" />
More background information can be found on Moz
Use 301 redirects
Where links are not canonical, use 301 permanent redirects to pass over the link juice to the new URL. Reference: Moz 301
Using rel="next" and rel="prev"
Where there's paginated content, use HTML attributes rel="next" and rel="prev" to indicate to google that the pages are paginated and linked. This will solve handle issues such as ?page=1 and ?page=2. Read more about Indicate paginated content at Google.
<link rel="prev" href="http://www.example.com/article?page=1">
<link rel="next" href="http://www.example.com/article?page=3">

Change domain, redirect and don't lose page rank [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
I have a well-known domain name and receive something like 5k visitors per day.
But i really want to change my domain and my pages title, a complete renew!
Have some way to do this without losing my page rank and visitors?
For example, now if someone from my country (brazil) search about a tablet my site will appear in first page.
In really, i have 3 sites with one domain.
shop.mydomain.com
forum.mydomain.com
www.mydomain.com (wordpress blog)
If possible i want to change just the shop domain.
A long time ago i read about a changes like that, 301 redirect or something like this that preserves your page rank and google position.
My new domain is exatcly the keywork that my visitors search, probably with this change i will get the first place in searches.
I do not want lose backlinks
Help please?
As Matt Cutts explains, a 301 redirect is the best way to redirect users:
If you need to change the URL of a page as it is shown in search engine results, we recommend that you use a server-side 301 redirect. This is the best way to ensure that users and search engines are directed to the correct page. The 301 status code means that a page has permanently moved to a new location.
This CSS Tricks article explains how to implement a 301 redirect, but essentially:
If you want to use a 301 redirect (which is the quickest, cleanest, and most search engine friendly option) to direct browsers to an entirely new website, place this line in the .htaccess of the old site
Redirect 301 / http://newsite.com/
If you only want to redirect a particular page, place this in the .htaccess of the old site
Redirect 301 /oldpage.html http://www.yoursite.com/newpage.html

Duplicated content on google. htaccess or robots.txt? [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
In my website I have the following categories url structure:
/category.php?id=6 (id=6 is for internet category)
My SEO friendly url is like:
/category/6/internet/
The problem is it can be accessed in any of those forms, and because of that, I'm getting duplicate content on google.
So, I'm wondering how can I fix that.
Should I disallow on robots.txt any urls with ? on it?
If so, how can I properly set it up?
Should I make a redirection "Permanently Moved" on .htaccess?
If so, how can I properly set it up?
My actual .htaccess for categories is like this:
RewriteRule ^category/([^/]*)/([^/]*)/$ category.php?id=$1&name=$2 [L]
You just need to set the canonical link tag in the head section of your pages
see http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html
and http://support.google.com/webmasters/bin/answer.py?hl=en&answer=139394
It will look something like
<link rel="canonical" href="http://www.example.com/category/6/internet/"/>
on the category 6 page
You could also do a 301 redirect for the category.php pages in your .htaccess by adding
RewriteRule ^category.php?id=([^&]*)&name=([^&]*) /category/$1/$2/ [R=301,L]
If you didn't want to go the route of rewriterules you could put the following code at the top of config.php:
if(preg_match('/^\/config\.php/', $_SERVER['REQUEST_URI'])){
header("HTTP/1.1 301 Moved Permanently");
header("Location: /category/{$_GET['id']}/{$_GET['name']}");
die();
}
Either way is up to you but I would use the rewriterule option to redirect to my SEO friendly URL If I were you
Or you get rid of the non-SEO url.
always generate SEO url (you should do that anyway for)
in category.php check if $_SERVER['REQUEST_URI'] is the seo one and if not redirect to it
I would suggest using a canonical link in the document head to ensure Google uses the correct URL. Google on Rel Canonical.
It's really easy to implement, just post this into the HEAD section of the page.
<link rel="canonical" href="/your/url"/>
Google treats the canonical link as a 301 redirect, which means you won't have any duplicate content issues. It also means most of the link juice gets passed on (between 90% and 99%). If you used robots.txt or .htaccess , the page that you're blocking off would lose all its SEO value.
Just make sure you do this for every page as it's a page specific rule. Linking to the domain root will effectively mean all your pages are 301 redirecting to the home page.

Categories