Magento Categories URL - url

cant seem to find anything related to this on Google. Though maybe I’m not searching the right keywords.
On Magento 1.6 I have a category I created. For example, "test". The seo url for that would have been:
mysite.com/test/
I then deleted the category(stupidly) and later recreated it. Now the category is called:
mysite.com/test-1/
Is there any way to reset the internal index or something so that I can once again have the url:
mysite.com/test/
Hope that makes sense and someone can help.
Thanks a lot for reading.

have you tried to write "test" in the "URL Key" field ?
This behavior has something to do with the "redirect 301" flag.
Bye
Giuseppe

Related

How to add PDF-Viewer Tab to Channel in Microsoft Teams?

Adding a PDF-Viewer tab to present/show a Sharepoint document has been working before.
I've tried this in January and it seemed to be an easy task - just get the DriveItem ID and URL (from GET /groups/{group-id}/drive/items/{item-id}) and edit the sample from the API Reference with these values (https://learn.microsoft.com/de-de/graph/teams-configuring-builtin-tabs#word-excel-powerpoint-and-pdf-tabs).
Now, that i want to use this, it doesn't work anymore ;-( The tab is created, added to channel, the name of the file shows BUT there is no document!!! What am i missing? Has the format changed? Has someone lately gotten this to work???
Please let me know, how! ;-)
ps: there is no description of the property "entityID" that makes any sense, can anyone explain it?
result in teams
Got the answer, was a Syntax problem!
The "contentURL" property needs to be unescaped (in this case the "%20"). It is that simple after all ;-)
Also i found out, the "entityID" property has no meaning for the File used. It can be "null" actually! I still use the ItemID i got from the DriveItem of the File.
For unescaping i used:
string contentUrl = Uri.UnescapeDataString(webUrl);
If it wasn't for this post I would have not gotten it figured out, so thank you!
For me I ended up having to make entityID null, just unescaping the contentURL didn't do it for me alone.
Thanks for your comment. leaving entityID null fixed my isse also.
I opend an issue to have the docs fixed!

How to access a reddit post using redditkit in ruby?

I have a reddit post link here:
https://www.reddit.com/r/dankmemes/comments/6m5k0o/teehee/
I wish to access the data of this post throught the redditkit API.
http://www.rubydoc.info/gems/redditkit/
I have tried countless times and the docs don't make too much sense to me. Can someone help show how to do this through the ruby console? Or even an implementation of this in rails would be really helpful!
Looking at the #comment method on the gem, it takes a comment_full_name and performs a GET to api/info.json with that parameter as an id (seen by viewing the source for that method). If we look at the reddit api for api/info the id parameter is a full name for the object with a link to what a full name is.
Following that link, a full name for a comment is
Fullnames start with the type prefix for the object's type, followed by the thing's unique ID in base 36.
and
type prefixes
t1_ Comment
So now we know the comment_full_name should be t1_#{comment's unique id} which appears to be 6m5k0o. Here, I'm unsure if that's already base36 or if they want you to convert that into base36 before passing it. Without seeing what all you've tried, I would say
client = RedditKit::Client.new 'username', 'password'
client.comment("t1_6m5k0o")
and if that doesn't work
client.comment("t1_#{'6m5k0o' base36 encoded}")
For questions like this, it would be nice to see some of your code and what you tried/results they gave. For all I know, you've already tried this and have a reason it didn't work for you.
I would test this out for you, but I don't have a reddit account for the gem to sign in with, this is just my guess glancing at the documentation.

Dropping tables because of GET method?

I have simple question. I did GET form search to get ID of a show, so after code is executed, the url looks like this:
...show.php?showid=inserted number
So, is it possible to drop all tables only because I used GET method, and therefore, should I use POST?
Thanks in advance!
"This is the canonical explanation here on SO of how to prevent SQL injection: stackoverflow.com/questions/60174/… – Andy Lester Feb 13 at 23:12"
Thanks. I'm not sure how to post comment as an answer, but this satisfied me. I tried SQL injection into my table, but probably not related one:' or '1'='1
And I get this:
403
Forbidden
Access to this resource on the server is denied!
So that's all. Thank you guys once again.

nokogiri and the href label

I am not sure how to access the label part of the anchor href tag. The other question that looks at this doesnt really answer it for me.
I have this code:
#name = page.css("#content").css("a")[1]
Which gives this result
generation xerox
I want to get at the "generation xerox" bit
I wouldnt mind getting at the href, I dont understand that either. I have read several other SO questions but I can't get it to work
Thanks in advance all
You can access the label with #name.text and the link with #name['href']
See doc

Why do some URLs contain both numeric id and name?

I am wondering why the link to profile looks like:
http://stackoverflow.com/users/ID/NAME
not simply:
http://stackoverflow.com/users/ID
or even better:
http://stackoverflow.com/users/NAME
Can there be couple users with the same name? Or can one user have many names?
All SO-URLs are of the form id/description where the ID is unique and the description is optional. So /users/12890/arne-burmeister is the same as /users/12890/huhu and /questions/420380/why-does-the-link-to-the-user-profile-have-both-id-and-name is the same as /questions/420380/foo. The retrieval just uses the ID, but it is much better for google ranking, when the user/question/what-ever-should-be-found occurs in the URL (also for humans this is much more descriptive ;-).
By the way, retrieval by ID is faster than by such a large text string. And of course, the URL remains valid if someone changes their user name or the question.
The part after the last slash seems to be SEO related (i.e. making the url more expressive).
On the urls that I tested you could replace that part with whatever you wanted, it still worked. So the url http://stackoverflow.com/users/37086/othername still points to your profile.
I would assume doing a database lookup solely on the name string would be more expensive than a numerical lookup on the primary key, even if the name column is indexed. The name is then added on to make the URLs more user and SEO friendly.
There is a uservoice request for this. If you want this to happen, uservoice is the right place to discuss / vote up.
Your name on SO is not unique click on users and type Josh, there's a whole page of us. So you have to have the ID. As for why the name everyone else's guess is as good as mine.
Try changing or removing the name and see what happens.
I think it's just so that your URLs tell you what to expect, but the application doesn't need (or actually use) that information.
Amazon does something quite similar with their books, if I remember correctly: They've got both the ASIN (their internal ID) and the name of the book in the URL, but only ever look up the ASIN.
Just speculating: The ID allows very fast retrieval of the data the profile page presents. The name is just for humans and ignored since it's easier for me to no that you are rkj and I am phihag than that your ID is 37086 and mine is 35070.

Resources