friendly-url

Spring Webflow 2 and bookmarkable URLs

此生再无相见时 提交于 2019-12-11 13:44:13
问题 Currently due to the Post/Redirect/Get pattern all flow urls are something like <site_url>/flow_name?execution=? and input GET parameters are not preserved. Thus the users can't copy the url, or bookmark it. Any suggestions how could this be done neatly ? 回答1: We can bookmark a SWF based application's URL by customising FlowHandlerAdapter of SWF API. Here is a sample: My SWF configuration file would have: <bean id="flowController" class="org.springframework.webflow.mvc.servlet.FlowController"

Apache: How can I both redirect foo.html to foo and rewrite foo to foo.html?

本小妞迷上赌 提交于 2019-12-11 12:11:20
问题 I'm hosting a website that's just a bunch of static .html files. I don't want to have the .html file extension in the URLs, so I've added a rewrite rule: RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.html -f RewriteRule ^(.+)$ /$1.html [L] This is simple enough and works fine, but I would now also like to redirect (302) URLs ending in .html to the canonical path, i.e. without the file extension. I've tried the following: RewriteCond %{REQUEST_FILENAME} \.html$

Username mod rewrite

走远了吗. 提交于 2019-12-11 11:06:13
问题 I need help with mod rewrite ...I'm trying to change domain.com/user.php?username=foo to domain.com/foo My current rewrite is: RewriteRule username/(.*)/ user.php?username=$1 [L] RewriteRule username/(.*) user.php?username=$1 [L] which outputs domain.com/username/foo but i'm not happy with that. 回答1: You want: RewriteRule ^(.*)/ user.php?username=$1 [L] RewriteRule ^(.*) user.php?username=$1 [L] This will send every request to user.php. If you don't want that it's probably better to send

ASP.NET WebForms: Request.GetFriendlyUrlFileVirtualPath() returns empty string

大城市里の小女人 提交于 2019-12-11 09:04:58
问题 I have got simple ASP.NET WebForms project with only few pages and I would like to use friendly URLs (not only for SEO but also localization of URLs). I use .NET 4.5 for this project and have tried to use Microsoft.AspNet.FriendlyUrls nuget package which looked like it might help. But there is one issue. I've got in Global.asax this: void Application_Start(object sender, EventArgs e) { // Code that runs on application startup BundleConfig.RegisterBundles(BundleTable.Bundles); RouteConfig

Friendly URL for images

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 08:09:15
问题 Please suggest me what to put into .htaccess file. I have PNG, GIF, JPG images on server http://domain.tld/images/anyimage.anyextension Want to make URLs more friendly like a http://domain.tld/anyimage.anyextension This I have now. First two strings change links as described. But last string doesn't change it back for server. RewriteCond %{REQUEST_URI} ^/images/(.+)(\.gif|\.jpg|\.png)$ [NC] RewriteRule ^image/(.+)$ /$1 [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST

Why we don't use such URL formats?

妖精的绣舞 提交于 2019-12-11 07:30:07
问题 I am reworking on the URL formats of my project. The basic format of our search URLs is this:- www.projectname/module/search/<search keyword>/<exam filter>/<subject filter>/... other params ... On searching with no search keyword and exam filter, the URL will be :- www.projectname/module/search///<subject filter>/... other params ... My question is why don't we see such URLs with back to back slashes (3 slashes after www.projectname/module/search)? Please note that I am not using .htaccess

Rewrite URL dynamic with title and id

感情迁移 提交于 2019-12-11 05:37:47
问题 I need to rewrite url dynamically with title and id. I want to make URL dynamically http://dev.example.com/beweb/iphone-8.html Instead of http://dev.example.com/beweb/newsdetails.php?id=8&title=iphone When i run the above URL so it is made dyanamically what i need.. but getting error " Not Found Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. The requested URL /beweb/iphone-8.html was not found on this server." I have used below

How to create friendly url's in asp.net 2

纵然是瞬间 提交于 2019-12-11 05:15:34
问题 I tried using the IHttpModule and managed to convert the urls just fine, but all of my images returned path error (all going through the new url directory). whats the solution? 回答1: You need to make sure that you use the "~/" path notation on your images and make sure that they are all server controls with runat='server'. Otherwise the images urls won't get rewritten. For example if you have a page that gets rewritten from: /Item/Bicycle.aspx to /Item.aspx?id=1234 Then what will happen is

URL rewrite in tomcat web.xml

北慕城南 提交于 2019-12-11 05:06:13
问题 I would like to automatically redirect requests for http://example.com to http://example.com/SomePage I am able to do that with Apache with the following rule: RewriteRule ^/$ /SomePage [R] However, some of my servers do not run on top of Apache, just Tomcat. How do I implement the equivalent in web.xml? SomePage is a struts2 action. 回答1: If you are using Tomcat alone instead of with Apache with modrewrite, the best approach is to install a rewrite filter and reference it from your web.xml.

Orkut's URL Writing Method

▼魔方 西西 提交于 2019-12-11 04:49:49
问题 I have a doubt about orkut's new URL Writing method. Earlier the home page was like http://www.orkut.com/Home.aspx Now its changed to http://www.orkut.co.in/Main#Home.aspx Whats the significance of "#" ? Why is it there and why have they used it? Is not "#" used to navigate to a particular section of Page using name="blah" in the anchor tag? 回答1: The URL fragment (#name) was historically used for in-page anchors, so that you could mark a section and have the page scroll just the right content