short-url

How to redirect - rewriten urls to short urls

感情迁移 提交于 2019-12-25 01:49:10
问题 I have changed my site url structure. But, Google indexed urls are giving 404 not found error. Now, I need a .htaccess rewrite rule for, From url: www.mydomain.com/topic-titles-here-t273.html To url: www.mydomain.com/sub-folder/topic273.html (Topic id must be cached and topic title must be removed.) Some times, like this also, From url: www.mydomain.com/topic-titles-here-t273-15.html To url: www.mydomain.com/sub-folder/topic273-15.html I searched a lot, for about three hours, But couldn't

CSS background-image won't show with short URL

拜拜、爱过 提交于 2019-12-24 01:53:44
问题 I've done my searching and the topics haven't been of help. I'm trying to have the background image of my header repeat across the X axis of the header div. When I make CSS with a long URL such as background-image:url('http://site.com/images/logo.png'); everything works fine When I try to shorten the CSS to something such as ~/images/ or even having the CSS and site file already in the root folder and using /images/ I get nothing background-image:url('~/images/logo.png') background-image:url(

file_get_contents() for short urls

馋奶兔 提交于 2019-12-21 14:46:53
问题 file_get_contents() doesn't read data for short urls Example: http://wp.me/pbZy8-1WM, http://bit.ly/d00E2C Please help me in handle this. OR Is there any CURL function to handle above links? 回答1: This in general works fine. If you find it doesn't do the right thing you can explicitly use a stream context: $url = "http://bit.ly/d00E2C"; $context = stream_context_create(array('http' => array('max_redirects' => 5))); $val = file_get_contents($url, false, $context); should do it. No need to touch

Dynamically generate short URLs for a SQL database?

萝らか妹 提交于 2019-12-13 16:42:05
问题 My client has database of over 400,000 customers. Each customer is assigned a GUID. He wants me to select all the records, create a dynamic "short URL" which includes this GUID as a parameter. Then save this short url to a field on each clients record. The first question I have is do any of the URL shortening sites allow you to programatically create short urls on the fly like this? 回答1: TinyUrl allow you to do it (not widely documented), for example: http://tinyurl.com/api-create.php?url

When using a unique alphanumeric string for a short url, is it better to store the created string in the database or encode/decode on the fly?

丶灬走出姿态 提交于 2019-12-11 06:04:57
问题 I want to create shortened links for specific pieces of content on my site. To view these pages now, I pull the relevant content via the content ID passed via GET (ie, mysite.com/content/?id=332). To obfuscate the ID, I want to use base64 to encode and decode it into a short alphanumeric string (like 34sa6), which I already know how to do. My question is this: does it make more sense to store this string as a database field on creation of each piece of content, or simply decode the string on

How to make this very long url appear short?

白昼怎懂夜的黑 提交于 2019-12-11 00:28:57
问题 I have made most my site SE friendly, but one part of my site bugs me... I have a HUGE form in one of the pages, and when submitting the form (action=php_page) URL is so long it covers half a word document in one line with all the passing variables... This is very ugly... Is there any way to make this long URL appear short? Or some other solution you know of? Let me know if you need more input... Thanks 回答1: How about using POST instead of GET? <form action="action.php" method="post"> In

how to generate short, unique urls

折月煮酒 提交于 2019-12-10 19:38:16
问题 I am trying to generate unique, short urls for items on my site. For example, a user might add an item and the resulting url would be something like: http://example.com/item/abc I was hoping for the unique identifier to be made up of 3 or 4 characters, where the characters are letters and numbers. I thought instead of randomly generating the strings and then making sure they are unique and haven't been used yet, I could generate them all ahead of time and store them in a database. Then when a

Generating short URLs in a distributed data store

三世轮回 提交于 2019-12-08 07:27:03
问题 Currently I run a web app that heavily relies on short URLs that link to the original content, these URLs need to be as short as possible. At the moment, I use a simple MySQL data store for storing these objects and an incrementing counter -> base 62 conversion to generate short urls that will grow over time. We need to move to a more distributed and scalable environment. What is the best way of generating small, unique short Urls for content in a distributed data store? To be specific we

Generating short URLs in a distributed data store

烂漫一生 提交于 2019-12-07 22:42:29
Currently I run a web app that heavily relies on short URLs that link to the original content, these URLs need to be as short as possible. At the moment, I use a simple MySQL data store for storing these objects and an incrementing counter -> base 62 conversion to generate short urls that will grow over time. We need to move to a more distributed and scalable environment. What is the best way of generating small, unique short Urls for content in a distributed data store? To be specific we plan to use either Mongo or DynamoDB . Chris Shain I'd suggest you have a look at Jon Skeet's description

Short URL or long URL for SEO

大兔子大兔子 提交于 2019-12-06 05:58:59
问题 I am implementing cs-cart for a web site. Which one is better for SEO if possible with a reason or reference. Site sells books stamps cds etc. www.domain.com/book/Java.html (or) www.domain.com/book/programming/Java.html or www.domain.com/Java.html Some says short URLs are good. But isnt it good that stating which category the product it is in. Thanks 回答1: You can go for both, via canonical URLs. For example, in the <head> of both /Java.html and /book/Java.html: <link rel="canonical" href="