My pagination url work at:
checkout.gr/home/index/4
and my webmaster tool see duplicate content for meta description & keywords for page
checkout.gr/home/index/4
checkout.gr/home/index/
and all pagination list…
And final i make slug article for friendly seo url but now my article work with 2 url example:
first url without slug
checkout.gr/magazine/index/3
ulr with slug
checkout.gr/magazine/index/3/to-penintaraki-byronas
and make again duplicate content again…
How can i fix it?
This is normal, you can counteract this behaviour in a number of different ways. Like a 301 redirect, sitemaps,...
you can find some more detailed information on this page (watch out, some solutions mentioned here are only relevant to google)
https://support.google.com/webmasters/answer/139066?hl=en
Related
I'm attempting to query a URL for my Strapi CMS to find a blog post by it's title, rather than ID, so I can link to it in my web app.
However, I can't figure out how to do it, and the Strapi documentation (from what I've found) only tells how to find by ID.
As an example, the following URL successfully finds all of my blog posts:
https://localhost:1337/blog-posts
The following URL successfully finds the blog post with an ID of '1':
https://localhost:1337/blog-posts/1
Attempting to then find the blog post with a title of "test title" using the following queries doesn't work:
https://localhost:1337/blog-posts/test%20title
https://localhost:1337/blog-posts/title/test%20title
https://localhost:1337/blog-posts/test_title
https://localhost:1337/blog-posts/title/test_title
I figured it would be either 1 or three on those above examples, but no luck.
As an FYI - there is an underscore in the above URLs without %20.
Any tips / pointers would be appreciated!
Strapi doc is fantastic and you can find everything:
You can fetch a single entry by ID (https://strapi.io/documentation/v3.x/content-api/api-endpoints.html#get-an-entry) and you are doing it correctly.
You can also fetch entries (https://strapi.io/documentation/v3.x/content-api/api-endpoints.html#get-entries) passing also filters in order to restrict the amount of entries you will receive.
Filters are well explained here: https://strapi.io/documentation/v3.x/content-api/parameters.html#filters.
In your case, you should call https://localhost:1337/blog-posts?title=test%20title in order to fetch the blog posts with the given title.
I have a scenario to create an SEO friendly URL in Code-igniter.
http://example.com/en/motors/used-car-for-sale/audi?sub_categories3=36
I want to create an SEO friendly url and remove the portion ?sub_categories3=36 from the url. The subcategory id 36 will be the 'A4'(Audi A4 car model).
So the url should be http://example.com/en/motors/used-car-for-sale/audi/a4 .
The sub_categories3 will be the id of each type under main category.
How can i do it?I found lot of articles to it.Please suggest me a best way to find it.
Pass all /motors requests to the correct controller with ('motors/(:any)') = 'myController/myFunction';
Get the second part of the url and pass it to a model that requests an article with that URL. Use the 'URL' helper for this.
Return data back to the controller and to your view.
I have a website that is developed with CodeIgniter. I have added the route for my url as follows:
$route['about_us'] = 'about-us';
Now I have a problem with that. I.e. when I am looking for the url www.mysite.com/about_us it works and at same time www.mysite.com/about-us is also working. I want only one url to work: the one with the underscore.
I have removed this to:
$route['about_us'] = 'about-us';
But the url www.mysite.com/about-us still works. It may cause duplicate content for my website in Google and so more page links also showing. Even I don't have that functions too. Like www.mysite.com/about_us/design. Likewise in about_us controller file index function only there, but design method calling in Google.
How do I resolve this problem?
You actually don't need a route here. The normal purpose of request routing the way you are using it is so that you can use hyphenated URLs when hyphens are not permitted in class and function names. I.E. you want the url to by www.example.com/test-controller, but you can't actually name a controller test-controller because the hyphen is illegal.
If you only want to have the underscored URL such as www.mysite.com/about_us then just remove the route completely and name the controller about_us. With no routing rules the hyphenated url should 404.
What i'm trying to do is to rewrite URLs to make them more SEO friendly but i still want to pass a parameter as an int ID.
For example, a URL pointing to a news article might look like this:
"www.domain.com/category-id/article-id" or "domain.com/5/3"
What i want to do is to rewrite the URL everywhere so that the title of the category and the title of the article are written into the URL so it becomes f.x. "domain.com/politics/some-title" but i still want to pass the ID of the article as an argument to the controller action. This is less important for the category but it's something i want to do with the article-id since it's unique but the title might not be.
I have checked out Attribute Routing and looked through some Routing guides and questions but haven't found anything that lets me implement this functionality. I've just started using ASP.NET MVC so i haven't been able to look into anything too advanced.
Thanks in advance.
I would advice to make the article title unique and from the controller action you have to get the article based on the title.
I see you are trying to group the articles based on category. When I initially created my blog I thought the same-thing but soon realized it's not a flexible approach because of couple of reasons.
Say you wrote one article with name some-title and dropped it under a category say politics and so the url will be domain.com/politics/some-title but at a later point of time you thought to move the article to another category say 'international-politics' therefore your url now has to be changed to domain.com/international-politics/some-title and you break the old url and whoever has bookmarked that link will now receive 404. A better way would be organize the urls based on the posted date and that's not going to change something like http://domain.com/archive/yyyy/mm/dd/unique_title
Sometimes you want to label an article with more than one category and at that time a tag based approach will become a better choice compared to category based approach.
Quick and dirty solutions:
1) domain.com/categoryName/articleID/articleName/
2) domain.com/date/categoryName/articleName (date should help make articleName unique)
3) domain.com/categoryName/articleName?id=xxx
Nothing fancy, but those approaches will work.
I know you probably don't get many questions like this...
I am working on a component that I want to be able to deal with the non-SEF URLs whilst SEF is enabled, whether it be the built-in SEF or something like sh404sef.
Does Joomla store the ORIGINAL non-SEF URL anywhere ie. index.php?com=com_fred&view=homepage?
I've found that any SEF activated, changes the JURI::getInstance() value to the SEF equivilant.
I've also found the the $REQUEST['URI'] value does not work on all platforms/servers etc.
Thanks for any help
Get all vars from the GET/POST request into an array. At this point you may also modify the values before generating the URL string.
$getVars = JRequest::get( 'GET' );
If you really need the URL string, you can obtained with:
$newURL = http_build_query($getVars);
Hope it helps!
I came back to this code and tried again but gave me some errors, so I've reworked it partially based on the previous answer I've formulated before with this new one (working nice on Joomla! 3.4.5)
// build the JInput object
$jinput = JFactory::getApplication()->input;
// retrieve the array of values from the request (stored in the application environment) to form the query
$uriQuery = $jinput->getArray();
// build the the query as a string
echo 'index.php?' . JUri::buildQuery($uriQuery);
Joomla! API Docs: JInput - JUri
PREVIOUS ANSWER:
Googling around I found this:
<?php
// "unparse" the Joomla SEF url to get the internal joomla URL
JURI::current();// It's very strange, but without this line at least Joomla 3 fails to fulfill the task
$router =& JSite::getRouter();// get router
$query = $router->parse(JURI::getInstance()); // Get the real joomla query as an array - parse current joomla link
$url = 'index.php?'.JURI::getInstance()->buildQuery($query);
?>
I've tested it with Joomla! 3.4.4 and its working fine! Dunno if it can work with 1.5
You can use JRequest::get(true) to get an array of all the query parameters from the URL. A quick note though, I haven't checked it enough to know if it only returns GET parameters or it does all REQUEST parameters (which I think is more likely). It might, however, help with what you're looking for.
For menu items, it's stored in the 'jos_menu' table, in the 'link' column (but the itemid is not in this string - it's the 'id' column).
For anything else, it's probably not stored in the database, but can normally be worked out pretty easily, especially with core components. It can be a little bit of a pain with third party components, but you can look through the MVC architecture of most components to figure it out.
Otherwise, you could always turn off SEF on your dev site/create a dev site for this.
Is there a specific component that you're curious about?
The link that I posted here:
Joomla URLs: An article doesn't have a pretty URL by itself?
provides a very good "crash course" for URLs in Joomla 1.5
You don't have to do anything special for non-SEF URLs. Even if you have SEF URLs turned on, Joomla will still display the correct page if someone access the site with a non-SEF URL. The portion of your component that handles SEF URLs, the router, only tells Joomla how to use the URL information to determine what to display. When presented with a non-SEF URL Joomla just parses the query string as it normally would.
For any given component, the URL is built like this -
index.php?option=com_name&view=XXXX&id=1111&Itemid=11111
option is the name of the component
view is of course which view to display
id is the id of the particular content item
itemid is the menu item it used to determine module/template assignment