friendly-url

Safe characters for friendly url [closed]

拟墨画扇 提交于 2019-11-26 04:59:56
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . I need to make a website that will have articles, and I would like to make friendly URLs for it, example the URL of the page with Title: Article Test should become: http://www.example.com/articles/article_test . Of course I need to remove some characters from the title like ? or # ,

How to hide the .html extension with Apache mod_rewrite

こ雲淡風輕ζ 提交于 2019-11-26 01:49:39
问题 I have a small number of static sites where I simply want to hide the .html extension: the url /foo fetches the static file /foo.html the browser still displays the url /foo The client can then send out bookmarks in the style mydomain.com/foo rather than mydomain.com/foo.html . It sounds very simple, and I\'ve used mod_rewrite happily before (say with WordPress or for redirects), but this is proving much harder to crack that I thought. Perhaps I\'m missing something really obvious, but I can\

How does Stack Overflow generate its SEO-friendly URLs?

我的未来我决定 提交于 2019-11-26 01:21:10
问题 What is a good complete regular expression or some other process that would take the title: How do you change a title to be part of the URL like Stack Overflow? and turn it into how-do-you-change-a-title-to-be-part-of-the-url-like-stack-overflow that is used in the SEO-friendly URLs on Stack Overflow? The development environment I am using is Ruby on Rails, but if there are some other platform-specific solutions (.NET, PHP, Django), I would love to see those too. I am sure I (or another

URL Friendly Username in PHP?

丶灬走出姿态 提交于 2019-11-26 00:58:18
问题 On my PHP site, currently users login with an email address and a password. I would like to add a username as well, this username they g\\set will be unique and they cannot change it. I am wondering how I can make this name have no spaces in it and work in a URL so I can use there username to link to there profiles and other stuff. If there is a space in there username then it should add an underscore jason_davis. I am not sure the best way to do this? 回答1: function Slug($string) { return

How to hide the .html extension with Apache mod_rewrite

喜夏-厌秋 提交于 2019-11-25 22:03:38
I have a small number of static sites where I simply want to hide the .html extension: the url /foo fetches the static file /foo.html the browser still displays the url /foo The client can then send out bookmarks in the style mydomain.com/foo rather than mydomain.com/foo.html . It sounds very simple, and I've used mod_rewrite happily before (say with WordPress or for redirects), but this is proving much harder to crack that I thought. Perhaps I'm missing something really obvious, but I can't find a solution anywhere and I've been at it all day! We run our own server, so this can go wherever is

How to create friendly URL in php?

余生长醉 提交于 2019-11-25 21:47:49
问题 Normally, the practice or very old way of displaying some profile page is like this: www.domain.com/profile.php?u=12345 where u=12345 is the user id. In recent years, I found some website with very nice urls like: www.domain.com/profile/12345 How do I do this in PHP? Just as a wild guess, is it something to do with the .htaccess file? Can you give me more tips or some sample code on how to write the .htaccess file? 回答1: According to this article, you want a mod_rewrite (placed in an .htaccess

How do I modify the URL without reloading the page?

自闭症网瘾萝莉.ら 提交于 2019-11-25 21:33:33
问题 Is there a way I can modify the URL of the current page without reloading the page? I would like to access the portion before the # hash if possible. I only need to change the portion after the domain, so it\'s not like I\'m violating cross-domain policies. window.location.href = \"www.mysite.com/page2.php\"; // Sadly this reloads 回答1: This can now be done in Chrome, Safari, Firefox 4+, and Internet Explorer 10pp4+! See this question's answer for more information: Updating address bar with

Reference: mod_rewrite, URL rewriting and “pretty links” explained

*爱你&永不变心* 提交于 2019-11-25 21:31:59
问题 \"Pretty links\" is an often requested topic, but it is rarely fully explained. mod_rewrite is one way to make \"pretty links\", but it\'s complex and its syntax is very terse, hard to grok and the documentation assumes a certain level of proficiency in HTTP. Can someone explain in simple terms how \"pretty links\" work and how mod_rewrite can be used to create them? Other common names, aliases, terms for clean urls: RESTful URLs, User-friendly URLs, SEO-friendly URLs, Slugging, MVC urls

URL Friendly Username in PHP?

大兔子大兔子 提交于 2019-11-25 20:53:19
On my PHP site, currently users login with an email address and a password. I would like to add a username as well, this username they g\set will be unique and they cannot change it. I am wondering how I can make this name have no spaces in it and work in a URL so I can use there username to link to there profiles and other stuff. If there is a space in there username then it should add an underscore jason_davis. I am not sure the best way to do this? function Slug($string) { return strtolower(trim(preg_replace('~[^0-9a-z]+~i', '-', html_entity_decode(preg_replace('~&([a-z]{1,2})(?:acute|cedil

How to remove file extension from website address?

限于喜欢 提交于 2019-11-25 18:58:27
I am designing a website. I want my website address to look like the following image: I don't want my website to look like http://something.com/profile.php I want .php extension to be removed in address bar when someone opens my website. In other words I want my website to be like: http://something.com/profile As a second example, you can look at the StackOverflow website address itself. Can someone please help me in getting this done? Thanks! Just add .htaccess file to the root folder of your site(for example, /home/domains/domain.com/htdocs/) with following content: RewriteEngine on