I have a problem with an unfriendly URL during filtration in Prestashop but my category URL looks good.
Now URL during filtration looks like this:
example.com/category?listorder=0&filters=W1siMjAiXSxbIjE1Il1d
I want them to look like this:
example.com/category?listorder=0&filters=value
Even better if they can look like that:
example.com/category/0/nameofatributeorfeature/value
Any solution?
I was looking for another solution but I don't think it depends on the "friendly URL" option in SEO & URL but It might be a mistake.
The category looks good like = example.com/21-category
Related
I was wondering if there was a way to find a URL when I am missing the middle. For example, I know that the beginning will be https://welldressedwolf/products/
and the end will be pretty-things but I do not know the middle portion.
With javascript you can get the full URL using window.location.href
After that you can remove the parts you dont want and you will have the middle.
More info: https://www.w3schools.com/js/js_window_location.asp
If you're looking to manually look up the address of a page, you could do so with a google search that specifies the site.
Try a site specific google search using something like the following:
"pretty things" site:welldressedwolf.com
Currently Wordpress produces this URL when searching for something on a website
websitename.com/?s=tools
I want to be able to have search links for a custom post type. The search itself wont be public but I will essentially be listing links to search:
Click Here For More Tools
this would be the url I can simply change the search query with
websitename.com/?s=[insert custom post type name here]tools
Is it possible to produce a url like above which only return results from a custom post type?
Thank you
This is an old question but maybe it will help others looking for something similar. The URL structure for your wordpress site should be like this: http://example.com/?s=my-search-string&post_type=custom-post-slug
All the best
I am using orchard 1.9 and I am building a service in which I need to get current URL.
I have OrchardServices and from that I can get the URL like so:
_orchardServices.WorkContext.HttpContext.Request.Url.AbsolutePath;
This works like a charm for pages/routes that I have created but when I go to the Login or register page (/Users/Account/LogOn) the absolute URL is / and I can't find anyway to get the URL or at least any indication that I am in the LogOn or Register.
Anyone knows how I could get the full url?
If I understand what your're asking, you could use the ItemAdminLink from the ContentItemExtension class.
You will need to add references to Orchard.ContentManagement, Orchard.Mvc.Html and Orchard.Utility.Extensions, but then you will have access to the #Html and #Url helpers.
From there you will have the ability to get the link to the item using:
#Html.ItemDisplayLink((ContentItem)Model.ContentItem)
The link to the item with the Url as the title using: #Url.ItemDisplayUrl((ContentItem)Model.ContentItem)
And you should get the same for the admin area by using these:
#Html.ItemAdminLink((ContentItem)Model.ContentItem)
#Url.ItemAdminUrl((ContentItem)Model.ContentItem)
They will give you relative paths, e.g. '/blog/blog-post-1', but it sounds like you've already got a partial solution for that sorted, so it would be a matter of combining the two.
Although I'm sure there are (much) better ways of doing it, you could get the absolute URL using:
String.Format("{0}{1}", WorkContext.CurrentSite.BaseUrl, yourRelativeURL);
...but if anyone has a more elegent way of doing it then post a comment below.
Hope that helps someone.
So, the problem seems simple at the beginning but is not. Using Mongo and Node.js.
Problem: I have a URL. I need to match that URL with all the URLs I have in my database. Remember, there is no rule that the URL I'm on always have "category" infront or things like that. And please don't take "cases" into consideration.
I have no clue of the name of parameters, or anything else.
Let's assume the URL is smth like example.com/category/product_name.html?session_id=2423412fd
In the database I only have example.com/product_name.html
The URL is smth like example.com/index.php?productid=6&category=3&utm_campaign=google&utm_source=click
In the database I only have example.com/index.php?productid=6
The URL is smth like example.com/product_name.html
In the database I only have example.com/category/subcategory/product.html
I think I made my point. What I'm looking is a solution that matches URL in any cases (they are more than these). It can be an external services, class or something complex.
But I need it to work, and to work very fast because is doing this on every page refresh.
Thank you!
I would use this function to separate the strings http://php.net/manual/en/function.parse-url.php
Then take parts of the path name which you want to match from the URL and query your database URL's looking for matches.
To follow on from Anagio's answer, the URL
example.com/index.php?productid=6&category=3&utm_campaign=google&utm_source=click
could be saved as a Mongo object like:
{
url: "example.com/index.php?productid=6&category=3&utm_campaign=google&utm_source=click",
indexes: [
"example.com",
"index.php",
"productid=6",
"category=3",
"utm_campaign=google",
"utm_source=click"
]
}
You could then split up any new URL using the same algorithm, then do a map/reduce on the indexes field for scoring and then take the highest score as the best "fuzzy match"
i would like a simple help...
i have a url like this:
example.com/profile.php?id= & name=
my .htaccess file like this.
RewriteRule ^profile/(.)/(.) profile.php?id=$1&name=$2
so i have a end url like this:
example.com/profile/id/name
i can make
example.com/id
but how can i get a url like this:
example.com/name
??
thax
Obviously, your profile.php script is expecting two GET variables, and your desired URL only has one. So you will probably have to change both the script and your database schema.
Your rewrite rule is subtly wrong. Yours will only select a single character in each of the bracketed parts. If you put a * after each dot, it will instead select one or more characters which I think is what you need.
RewriteRule ^profile/(.*)/(.*) profile.php?id=$1&name=$2
If what you're looking for is exactly this:
example.com/name
You will need to change your profile.php to only expect the name variable, and use it to query the database.
I believe previously you had something like:
mysql_query("SELECT * from table where id=$id");
You will need to change it to be
mysql_query("SELECT * from table where name$name");
So you are telling your page to query the user by the name, instead of by the ID.
There's a few drawbacks related to this, as your query won't be as fast as it used to be, as I believe your name column is not the primary key, therefore no indexing.
Twitter uses Rails, so they will be calling it in a slightly different way using something like (onMissingMethod):
get_user_by_username()
Which isn't great either, as it's still querying the database by a string, but has some performance improvements to enable rails to do that.
Your htaccess will then looki like:
RewriteRule ^(.*) profile.php?name=$1
Hope that answers your question