friendly-url

Is it better to handle friendly/clean/pretty URLs with mod_rewrite or a language like PHP?

﹥>﹥吖頭↗ 提交于 2019-12-03 09:43:09
问题 I'm developing my first decent-sized PHP site, and I'm a bit confused about what the "right way" (assuming there ever is such a thing) to handle clean/friendly/pretty URLs in the application. The way I see it, there are two main options (I'll use a simplified social news site as an example): 1. Use mod_rewrite to handle all potential URLs. This would look similar, but not identical, to the following: RewriteRule ^article/?([^/]*)/?([^/]*)/?([^/]*) /content/articles.php?articleid=$1&slug=$2

ÅÄÖ: what is considered more SEO friendly URL

感情迁移 提交于 2019-12-03 09:24:52
问题 As far as I can tell I shouldn't be using ÅÄÖ (somthing like they have no visual representation in ASCII??). So what is considered more SEO friendly? Replacing i.e. all "ä" with "a" or "ae"? (The CMS Umbraco replaces with ae and I'm leaning towards this). EDIT: Summary of how some Swedish sites does it: aftonbladet.se/ ä => a (http://www.aftonbladet.se/kropphalsa/) uppsatser.se/ ä => ä (http://www.uppsatser.se/om/v%C3%A5rd+av/) lindqvist.com/ ä => a (http://www.lindqvist.com/b/google-maps

Friendly url scheme?

风格不统一 提交于 2019-12-03 08:47:15
One of the many things that's been lacking from my scraper service that I set up last week are pretty URLs. Right now the user parameter is being passed into the script with ?u= , which is a symptom of a lazy hack (which the script admittedly is). However, I've been thinking about redoing it and I'd like to get some feedback on the options available. Right now there are two pages, update and chart, that provide information to the user. Here are the two possibilities that I came up with. "1234" is the user ID number. For technical reasons the user name unfortunately cannot be used: http://< tld

django username in url, instead of id

烂漫一生 提交于 2019-12-03 03:55:53
in a mini virtual community, i have a profile_view function, so that i can view the profile of any registered user. The profile view function has as a parameter the id of the user wich the profile belongs to, so that when i want to access the profile of user 2 for example, i call it like that: http://127.0.0.1:8000/accounts/profile_view/2/ My problem is that i would like to have the username in the url, and NOT the id. I try to modify my code as follows, but it doesn't work still. Here is my code: view: def profile_view(request, user): u = User.objects.get(pk=user) up = UserProfile.objects.get

Can an “SEO Friendly” url contain a unique ID?

ぐ巨炮叔叔 提交于 2019-12-03 00:42:26
问题 I'd like to start using "SEO Friendly Urls" but the notion of generating and looking up large, unique text "ids" seems to be a significant performance challenge relative to simply looking up by an integer. Now, I know this isn't as "human friendly", but if I switched from http://mysite.com/products/details?id=1000 to http://mysite.com/products/spacelysprokets/sproket/id I could still use the ID alone to quickly lookup the details, but the URL itself contains keywords that will display in that

Grails - Language prefix in url mappings

若如初见. 提交于 2019-12-02 19:51:21
问题 Hi there im having problem with language mappings. The way i want it to work is that language is encoded in the url like /appname/de/mycontroller/whatever If you go to /appname/mycontroller/action it should check your session and if there is no session pick language based on browser preference and redirect to the language prefixed site. If you have session then it will display english. English does not have en prefix (to make it harder). So i created mappings like this: class UrlMappings {

Best way to format pretty URLs for numeric IDs

人走茶凉 提交于 2019-12-02 19:44:59
Alright, so let's say I'm writing a forum application, and I want pretty URLs. However, all my tables use numeric IDs, so I'm not sure the best way to format the URLs for those resources. Let's pretend I'm trying to get a topic with ID 123456 and title This is a forum post . I've seen it done a couple ways: www.example.com/topic/123456 www.example.com/topic/this-is-a-forum-post www.example.com/topic/123456/this-is-a-forum-post Which one would you say is, taking all things into consideration (including SEO), the optimal URL? Sorry if this question is too vague, but it seems programming-related

Mod_rewrite - how to 301 redirect an old URL to a new one

只愿长相守 提交于 2019-12-02 18:48:36
问题 I need to grab some of my website's old URLs and do a 301 redirect to the new ones, since they are already indexed and we don't want to loose relevance after the change. The old URL is in fact very ugly and for some reason everything I try to do to rewrite it does not work. Here it is: http://www.mywebsite.com/ExibeCurso.asp?Comando=TreinamentoGeral&codCurso=136&Titulo=Como%20Estruturar%20um%20Sistema%20Gerencial%20de%20Controles%20Organizacionais,13 Basically, I need to translate it into

How to translate “Lorem 3 ipsum dolor sit amet” into SEO friendly “Lorem-3-ipsum-dolor-sit-amet” in Java?

那年仲夏 提交于 2019-12-02 13:36:36
问题 In my blog app, a user can enter any text as a title for their entry and then I generate a URL based on the text. I validate their title to make sure it only contains letters and numbers . If they enter something like Lorem 3 ipsum dolor sit amet how could I generate the more SEO friendly version of this text: Lorem-3-ipsum-dolor-sit-amet 回答1: It's in practice really not as simple as replacing spaces by hypens. You would often also like to make it all lowercase and normalize/replace

Friendly Url .htaccess

旧巷老猫 提交于 2019-12-02 10:03:56
问题 I have tried to follow the directions on .htaccess short and friendly url but am unable to achieve these results. If I use the following it works fine: RewriteEngine On RewriteRule ^([^/]*)\.html$ /index.php?page=$1 [L] However if I use: RewriteEngine On RewriteRule ^([^/]*)$ /index.php?page=$1 [L] I receive an internal server error. All I am trying to achieve is to be able to use http://website.com/about instead of http://website.com/about.html 回答1: These rules: RewriteEngine On RewriteRule