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 9 years ago.
Improve this question
I am looking for search google search result more like this: http://goo.gl/T3xUnC where many pages are shown. But instead I am getting this: http://goo.gl/it5EKh. I am wasted week finding good solution. Please help me out here...
It might be off topic but a you need to have a sitemap and robots.txt (pointing to sitemap.xml)
robots.txt
User-agent: *
Allow: /
Sitemap: /sitemap.xml
sitemap.xml (Wich contains all of your url's)
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://www.example.com/</loc>
</url>
<url>
<loc>http://www.example.com/folder1/</loc>
</url>
</urlset>
The next time google crawls it will index your page like you want it (this can take a while, so don't expect that it will work tomorrow).
You have to follow the HTML conventions and structure it well. If you have enough visitors(so quality content is very important) they will link to your page(backlinks) and after a while Google will pick this up and with a bit of luck they will generate the site links for you.
Related
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 7 years ago.
Improve this question
let you explain every point:
I have duplicate title issue with 404 error pages, I have redirect all pages with 301 redirection with use of WordPress Plugin. And it works and decrease the error, After that I have update plugin sitemap-index, and all error are back. I have checked some of the link and redirect, I have used robots.txt to block links which are having 301 redirect.
Does it effect, if we redirect more then one link in single page?
Does I need to remove 301 redirection to solve duplicate title?
Does I need to use different link for redirect?
Thanks in advance
Digant
Don't block the 301 redirected links with robots.txt. Google needs to reprocess those links/pages to take your latest modifications into account.
Does it effect, if we redirect more then one link in single page?
No, there is no issue with that.
Does I need to remove 301 redirection to solve duplicate title?
To solve duplicate title, you need to set different titles in each page and let Google reprocess your pages. Don't block them in your robots.txt.
Does I need to use different link for redirect?
This question is not clear to me. Anyway, redirects are unrelated to titles. Titles are defined in the <head> section of a document.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
Please I have this url
http://sub.maydomaine.com/wallpapers.php?category=cities&name=San%20francisco
I want redirect to
http://sub.maydomaine.com/wallpapers/cities/San%20francisco
Please help me .
If you add this rewrite rule, you should be able to support both urls:
RewriteRule ^wallpapers/([^/]+)/([^/]+)$ wallpapers.php?category=$1&name=$2 [QSA]
Hope this helps.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Hi I currently run a multilingual website organized as follow:
site.com/fr/ (france),
site.com/be/ (belgium),
site.com/uk/ (UK)
...
and site.com is a page where we can select countries/ languages.
I heard and read that it's not a good practice to do so, that I should rather set a default language for site.com
my question are:
1- should i add for example US english as default language?
2- remove the /fr/ and set a permanent redirect to the root (.com/fr/product redirected to .com/product)
3- or maybe do you have better suggestions?
Thanks you so much in advance
I do the same thing with one of my sites. But, in PHP, I change the position of the root (with or without /fr/ links). That way I can use a default language: site.com/
I choose this language automatically, with user browser language preferences. For the first page, and after link to the correct language (or to others with links). For me, it's the best SEO solution.
I just have to add rel="canonical" link elements, to avoid the duplicate or similar content:
Google: Use canonical URLs
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
Firstly, I viewed mod_rewrite - how to redirect a mistyped 'pretty' url however the OP is wanting his mistyped URL's to redirect to the correct, I simply want mine to error404.
quick question. I am looking for a solution to improve upon some mod re_write code I have.
Currently if someone was to enter an URL on my site that was a product page I.e. "/products/[category]/[product-name]" the .htaccess file has the following code
RewriteRule ^products\/([^/]+)\/([^/]+)$ ?page=product&product=$2 [L]
Which works exactly as intended however if someone mistyped only the [product-name] the template page still loads using that product-name in the URL as a variable and not landing a 404 error.
I handle all error pages like thus:
#ErrorDocument 404 /index.php?page=error404
Hoping someone can shine a light on how to adapt the former rewrite rule so pages that don't exist I.e. if we had a product called kettle and someone typed in ketle at the end of the URL it would 404 rather than still load the template page with ketle as the GET var.
Thanks in advance.
I'm assuming that you're index.php script handles the "page" and "product" parameters. It's going to be the only one that's going to know whether the "product" parameter actually points to a valid product name or not. If not, then you need to use the header function to generate the 404, and then display the contents of page=error404.
The htaccess file and mod_rewrite isn't going to know whether a page name is correct or mistyped, only the script that does the lookup will know.
You can even write a PHP script into the <head> element of your dynamic page, with this format as an example:
$con = mysqli_connect("$hostname", "$username", "$password", "$database");
if (mysqli_connect_errno()) {
echo mysqli_connect_error();
}
$result = mysqli_query($con, "SELECT content FROM pages WHERE id = $value LIMIT 1");
if (0 = mysqli_fetch_array($result)) {
echo '<meta http-equiv="location" content="URL=http://www.yourdomain.com/index.php?page=error404">';
}
Note: double check the code above if it's right, for it's just an example, and didn't reviewed well the syntax and if mysqli_fetch_array() is used to count the row(s) on the $result of the SQL queries.
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 11 years ago.
Improve this question
I'm trying to get the string /index.php?page=home behind the adress in de adressbar when people visit the root of my site.
I tried rewrite rules in .htaccess but it redirects to the .php without any css etc.
Like this:
RewriteRule (.*) index.php?page=home
I tried javascript rewrite but it reloads the page
Like this:
window.location.href = "/index.html?page=home"
My page already takes the arguments and follow a javascript function, but I would like to just simply add something to the current URL in the bar, without reloading or doing anything else.
Any ideas?
By the sound of it, you'll have to use the hash to do what you want. You can go from http://example.com/#home to http://example.com/#contact without reloading the page, but you cannot go from http://example.com/index.php?page=home to http://example.com/index.php?page=contact without reloading the page.
You can set and read from the hash using window.location.hash in javascript.