url-rewriting

What to do with a community URL style like Last.FM or Wikipedia?

时光总嘲笑我的痴心妄想 提交于 2019-12-05 23:53:58
I'm trying to understand how I should work with characters in URLs , this because I'm building a site where the user can store content and go to the content's page by digiting it's name in the URL . so, something like Wikipedia or Last.FM website. I see in the site, user can write something like http://it.wikipedia.org/wiki/Trentemøller and the page of the artist can reached. after the page is loaded, if I copy the URL i see written as: http://it.wikipedia.org/wiki/Trentemøller but if I paste it into a text editor, it will be pasted as http://it.wikipedia.org/wiki/Trentem%C3%B8ller so the char

Using .htaccess to change directory in url

醉酒当歌 提交于 2019-12-05 23:49:31
I am trying to change the url that is displayed in the address bar from mysite.com/blog/wedding-hair/ to mysite.com/services/wedding-hair/ using .htaccess. Using answers from: https://stackoverflow.com/questions/8713319/assigning-different-name-to-existing-folder-in-url-in-htaccess , rewrite a folder name using .htaccess , and Replace directory name in url with another name I added to the .htaccess file. Here is the .htaccess file, I added the last rewrite rule: Options -Indexes RewriteEngine on RewriteCond %{HTTP_HOST} ^mysite.com$ RewriteRule ^/?$ "http\:\/\/www\.mysite\.com" [R=301]

nginx Wordpress URL rewrite

坚强是说给别人听的谎言 提交于 2019-12-05 22:40:42
I've just installed nginx 1.0.8 and php-fpm and for the last 30 minutes I'm trying to rewrite the URL for Wordpress. Here is what the Wordpress URL should look like: http://localhost/website/blog/2011/10/sample-post/ I've looked at this tutorial: http://wiki.nginx.org/WordPress + many other on the web but every time I receive an 404 error (sometimes 403). Here is what I did in my configuration file: location /website/blog { try_files $uri $uri/ /website/blog/index.php; } location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document

Postback problem when using URL Rewrite and 404.aspx

纵饮孤独 提交于 2019-12-05 22:37:09
I'm using URL rewrite on my site to get URLs like: http://mysite.com/users/john instead of http://mysite.com/index.aspx?user=john To achive this extensionless rewrite with IIS6 and no access to the hosting-server I use the "404-approach". When a request that the server can't find, the mapped 404-page is executed, since this is a aspx-page the rewrite can be performed (I can setup the 404-mapping using the controlpanel on the hosting-service). This is the code in Global.asax: protected void Application_BeginRequest(object sender, EventArgs e) { string url = HttpContext.Current.Request.Url

What is the precedence of multiple mod_rewrite rules in multiple .htaccess files? [closed]

↘锁芯ラ 提交于 2019-12-05 22:32:25
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I understand that the [L] following a rewrite rule means that it's the "last" but I'm not clear what the scope is For example, when there are multiple .htaccess files, some with [L] , which ones will apply? Example: root.com/subdirectory1/subdirectory2 ^ ^ ^ | | | A B C If there is an .htaccess file in each

Is it possible to use mod_rewrite htaccess to rewrite a url from name to id.

北战南征 提交于 2019-12-05 21:55:06
If I have a URL http://www.domain.com/listing.php?company_id=1 is it possible for me to re-write that to http://www.domain.com/company-name by using that id to pull the name from the database. Or do I have to change listing.php to make it ?company_name=company-name If anyone can point me in the right direction that would be great. Thanks! A map function allows using no id in the url at all, while still using the id in the rewritten url to do the database lookup. http://www.domain.com/another-one maps to http://www.domain.com/listing.php?company_id=3423 Here is how I use map text files, which I

HttpModule URL rewriting using IIS6 with no extensionless URLs

ε祈祈猫儿з 提交于 2019-12-05 21:34:54
We are using the Intelligencia URLRewriting module for asp.net with version 2.0 of the framework and IIS6. Our URLs typically have no extension. I understand that IIS6 cannot really deal with this situation without a blanket wildcard (which causes other problems). However, it works! Sometimes. At other times (e.g. on one dev's machine, and on my machine when I point a different virtual directory at the app) it doesn't. By "it doesn't work" I mean the configured HttpModules never even get hit. Can anyone explain this? Thanks. So it turns out what was happening was the following: request comes

How to remove empty parameter or parameters anywhere in URL by .htaccess?

不问归期 提交于 2019-12-05 21:12:47
Empty parameters that I mean can be anywhere in URL each time different place, each time with different name, each time on different php page e.g : http://www.example.com/AnyPHPpageHere.php?parameter1=7&parameter2=&parameter3=blue&parameter4= to the form: http://www.example.com/AnyPHPpageHere.php?parameter1=7&parameter3=blue So how to do it via .htaccess? You can use this URL to remove any one or more empty parameters from anywhere in URLs: RewriteEngine On RewriteCond %{QUERY_STRING} ^(.+?&)?[^=]+=(?:&(.*))?$ RewriteRule ^ %{REQUEST_URI}?%1%2 [R=302,L,NE] Try : RewriteEngine on RewriteCond %

Zend Framework - how to rewrite url to seo friendly url

眉间皱痕 提交于 2019-12-05 20:18:12
I got website on Zend Framework (im total noob in Zend). For example I would like to make one URL " somewebsite.com/test/about " to look like this " somewebsite.com/for-fun-link ". How do i achieve this in Zend ? Im newbie in Zend and Apache server. Where i do rewrites in Zend ? I want static URL somewebsite.com/page/about rewrite to somewebsite.com/about-product And last question: where do i usually create rewrites ? its depends of sever/technology ? In your bootstrap, you'll need to configure some "routes". So, if your bootstrap ends something like this: $frontController = Zend_Controller

How to add a new page in Lift framework

心已入冬 提交于 2019-12-05 20:14:18
How can I add a new page in the webapp directory in lift that can be accessed by users? Currently only the index.html can be accessed through http://localhost:8080/ or http://localhost:8080/index.html Say I add a static file newpage.html into webapp dir, then what can I do so users can access it through http://localhost:8080/newpage.html ? It's been a long time since I've done anything with Lift, but from what I remember, the easiest way may be to add the page in the menu entries in the bootstrap.liftweb.Boot.scala class. If you've setup your project using one of Lift's maven archetypes, this