friendly-url

Rewrite all queries to not need the .php extension using a mod_rewrite RewriteRule

本小妞迷上赌 提交于 2019-11-26 18:25:04
问题 I'd like all queries like http://mysite.com/something/otherthing?foo=bar&x=y to be rewritten as http://mysite.com/something/otherthing.php?foo=bar&x=y In other words, just make the .php extension optional, universally. 回答1: I would do it this way. Basically, if file doesn't exist, try adding .php to it. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)$ $1.php [QSA,L] 回答2: If you can change the httpd.conf and what to, you can also put: ForceType

Customize FacesServlet <url-pattern> to get rid of .xhtml extension

一个人想着一个人 提交于 2019-11-26 16:17:57
问题 I have Login.xhtml and Home.xhtml . I configured the url pattern in web.xml as follows <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>/faces/*</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>Login.xhtml</welcome-file> </welcome-file-list> When I run the whole project, the login page URL is like this http://localhost:8080/fran/Login.xhtml , here fran is my project name.. However, I would like it to be http://localhost:8080/fran/Login/ instead of

Do SEO-friendly URLs really affect a page&#39;s ranking?

牧云@^-^@ 提交于 2019-11-26 15:35:19
问题 SEO-friendly URLs are all the rage these days. But do they actually have a meaningful impact on a page's ranking in Google and other search engines? If so, why? If not, why not? (Note that I would absolutely agree that SEO-friendly URLs are nicer to use for human beings. My question is whether they actually make a difference to the ranking algorithms.) Update: As it turns out, the Google post that endorphine points to here has caused tremendous confusion in the SEO community. For a sampling

What makes a “friendly URL”?

一个人想着一个人 提交于 2019-11-26 15:09:14
问题 I've read a great deal of discussion recently (both on this site and elsewhere) about "friendly URLs" but I'm not sure what exactly makes a URL "friendly" and why we really even care (up to a certain point). Illustration: The following is an example of a URL that would be held up by the majority of current web developers as "friendly": www.myblog.com/posts/123/this-is-the-name-of-my-blog-post Whereas this would be considered "unfriendly" (i.e. bad, Neanderthal, ignorant, stupid): www.myblog

Should I use accented characters in URLs?

早过忘川 提交于 2019-11-26 12:57:46
问题 When one creates web content in languages different than English the problem of search engine optimized and user friendly URLs emerge. I\'m wondering whether it is the best practice to use de-accented letters in URLs -- risking that some words have completely different meanings with and without certain accents -- or it is better to stick to the usage of non-english characters where appropriate sacrificing the readability of those URLs in less advanced environments (e.g. MSIE, view source). \

Why do some websites add “Slugs” to the end of URLs? [closed]

江枫思渺然 提交于 2019-11-26 12:20:03
问题 Many websites, including this one, add what are apparently called slugs - descriptive but as far as I can tell useless bits of text - to the end of URLs. For example, the URL the site gives for this question is: https://stackoverflow.com/questions/47427/why-do-some-websites-add-slugs-to-the-end-of-urls But the following URL works just as well: https://stackoverflow.com/questions/47427/ Is the point of this text just to somehow make the URL more user friendly or are there some other benefits?

Friendly URLs for ASP.NET

社会主义新天地 提交于 2019-11-26 11:56:15
问题 Python frameworks always provide ways to handle URLs that convey the data of the request in an elegant way, like for example http://somewhere.overtherainbow.com/userid/123424/ I want you to notice the ending path /userid/123424/ How do you do this in ASP.NET? 回答1: This example uses ASP.NET Routing to implement friendly URLs. Examples of the mappings that the application handles are: http://samplesite/userid/1234 - http://samplesite/users.aspx?userid=1234 http://samplesite/userid/1235 - http:/

Is a colon `:` safe for friendly-URL use?

守給你的承諾、 提交于 2019-11-26 08:01:32
问题 We are designing a URL system that will specify application sections as words separated by slashes. Specifically, this is in GWT, so the relevant parts of the URL will be in the hash (which will be interpreted by a controller layer on the client-side): http://site/gwturl#section1/section2 Some sections may need additional attributes, which we\'d like to specify with a : , so that the section parts of the URL are unambiguous. The code would split first on / , then on : , like this: http://site

How can I create a friendly URL in ASP.NET MVC?

允我心安 提交于 2019-11-26 07:58:36
问题 How do I generate friendly URLs within the ASP.NET MVC Framework? For example, we\'ve got a URL that looks like this: http://site/catalogue/BrowseByStyleLevel/1 The 1 is Id of the study level (Higher in this case) to browse, but I\'l like to reformat the URL in the same way StackOverflow does it. For example, these two URLs will take you to the same place: https://stackoverflow.com/questions/119323/nested-for-loops-in-different-languages https://stackoverflow.com/questions/119323/ EDIT: The

Generate SEO friendly URLs (slugs)

梦想的初衷 提交于 2019-11-26 06:29:18
问题 Definition From Wikipedia: A slug is the part of a URL which identifies a page using human-readable keywords. To make the URL easier for users to type, special characters are often removed or replaced as well. For instance, accented characters are usually replaced by letters from the English alphabet; punctuation marks are generally removed; and spaces (which have to be encoded as %20 or +) are replaced by dashes (-) or underscores (_), which are more aesthetically pleasing. Context I