friendly-url

How to ignore some route while using ASP.NET Friendly URLs?

北城以北 提交于 2019-11-29 14:46:04
问题 I am using ASP.NET Friendly URLs with success, but I need to ignore route for a particular Foo.aspx page (because this page needs POST data and once re-routed the POST data is not available anymore in Page_Load() !). It looks like using ASP.NET Friendly URLs discard any attempt to ignore a route. Even the MSDN example for ignoring route doesn't work once ASP.NET Friendly URLs routing is used: routes.Ignore("{*allaspx}", new {allaspx=@".*\.aspx(/.*)?"}); And to ignore route to Foo.aspx the

Page.RouteData.Values are empty for one page but not another

可紊 提交于 2019-11-29 11:24:58
I have Routing working in ASP.NET c# WebForms using Microsoft.AspNet.FriendlyUrls but not for all pages. Here is an example: routes.MapPageRoute("List/{Location}/{ZipCode}/", "List/{Location}/{ZipCode}/", "~/List.aspx"); On the above mentioned page (List.aspx) in the page_load there are no values.count in the Page.RouteData. Page.RouteData.Values.Count == 0 I have another page in the same site with this info matched to it: routes.MapPageRoute("{Location}/{ZipCode}/{Name}/{LocID}/{ID}/{Code}/", "{Location}/{ZipCode}/{Name}/{LocID}/{ID}/{Code}/", "~/place.aspx"); This page (place.aspx) always

How to create user-friendly and seo-friendly urls in jsf?

依然范特西╮ 提交于 2019-11-29 04:20:09
For example, I have class Article with methods getTitle () and getContent () . I also have ArticlesService with method getAllArticles () . How to create a list of links with meaningful names (formed with #{article.title} )? Like: http://mysiteaddress.com/article/first-article-title http://mysiteaddress.com/article/how-to-make-links-in-jsf ..or something similar. I can create links with all necessary functionality with <h:commandLink> , but I don't know how to make nice 'href' for it: it always has href '#'. I can create nice links with <h:outputLink> but I don't know how to add necessary

Most effective way to code SEO friendly URLs?

拥有回忆 提交于 2019-11-29 02:38:41
I currently use .htaccess and PHP to parse URLs in the following way: URL : http://blah.com/article/123_this-that-and-the-other .htaccess : RewriteEngine On RewriteRule ^article/([0-9]+)_(.+)/?$ index.php?page=article&id=$1 [L] PHP $page = isset($_GET['page']) ? safeGET($_GET['page']) : null; $id = isset($_GET['id']) ? safeGET($_GET['id']) : null; if ($page=='article') { include 'article.php'; } elseif { ... } I've begun running into problems with the far-too-paranoid Mod_Security engine that doesn't like the word "admin" in my $_GET requests. But mostly I'm just looking for new techniques for

foo.com/alice vs. foo.com/users/alice

…衆ロ難τιáo~ 提交于 2019-11-29 02:06:22
It's of course nice to give users friendly URLs for their content on your site. But how best to do that? There are a lot of advantages to something like foo.com/users/alice, most importantly that you aren't cluttering up your root namespace. But I think simplicity for users trumps all that. A lot of big sites seem to agree (friendfeed, delicious, and flickr come to mind) and this question is about how to accomplish that on the server side. Let's assume the real URL for alice is foo.com/userpage?user=alice and that if someone tries to surf to a nonexistent user page (let's say foo.com/bob) they

ASP.NET turn off FriendlyURLs mobile.master page

谁说胖子不能爱 提交于 2019-11-29 01:20:03
I would like to turn the Site.Mobile.Master page off completely. My site is responsive and i want mobile browsers to use the same master page. How can i do this in ASP.NET friendly URLs Thanks Delete the Site.Mobile.Master page, and Friendly URLs will just use the regular Site.Master page instead. There actually seems to be a bug in the current version of Web Forms friendly URLs (1.0.2) that makes this attempted access to the site.mobile.master break with "The relative virtual path 'Site.Mobile.Master' is not allowed here." in the friendly URL code. I just was burned by this. To fix it, I used

Regular expression - any text to URL friendly one

人走茶凉 提交于 2019-11-28 21:37:36
PHP regular expression script to remove anything that is not a alphabetical letter or number 0 to 9 and replace space to a hyphen - change to lowercase make sure there is only one hyphen - between words no -- or --- etc. For example: Example: The quick brown fox jumped Result: the-quick-brown-fox-jumped Example: The quick brown fox jumped! Result: the-quick-brown-fox-jumped Example: The quick brown fox - jumped! Result: the-quick-brown-fox-jumped Example: The quick ~`!@#$%^ &*()_+= ------- brown {}|][ :"'; <>?.,/ fox - jumped! Result: the-quick-brown-fox-jumped Example: The quick 1234567890 ~`

Pretty URLs in Google App Engine

余生颓废 提交于 2019-11-28 08:28:51
I want to pass a parameter 'A1B2C3' to a GWT application based on Google App Engine. I do it like www.example.com/index.html?key=A1B2C3. Although it's working, I'd like to use pretty URLs. Is it possible to do URL rewriting on Google App Engine? I couldn't find out how. www.example.com/A1B2C3 instead of www.example.com/index.html?key=A1B2C3 I'm using Google App Engine and GWT. All in Java. This is a cool question. I figured out how to do it for python as well. app.yaml: - url: /test/(.*) script: test.py \1 test.py: #!/usr/bin/env python import sys def main(): for arg in sys.argv: print arg if

Mode Rewrite; with/without trailing slash on end of url?

无人久伴 提交于 2019-11-28 07:03:39
I basically tried this mode_rewrite rule below. It works with a slash on the end but I want it to work whether it has a trailing slash on the end or not. Basically I want it like this as some people see it as normal with a slash on the end and others don't hence why I want it to work whether it's there or not. RewriteRule ^signup/register(.[^/]*) /signup/register.php [NC] Basically it will work like http://localhost/signup/register/ but if I remove the / from the end it gives 404 error. The subpattern .[^/]* requires at least one arbitrary character. In your case it’s probably that trailing

Page.RouteData.Values are empty for one page but not another

这一生的挚爱 提交于 2019-11-28 04:40:30
问题 I have Routing working in ASP.NET c# WebForms using Microsoft.AspNet.FriendlyUrls but not for all pages. Here is an example: routes.MapPageRoute("List/{Location}/{ZipCode}/", "List/{Location}/{ZipCode}/", "~/List.aspx"); On the above mentioned page (List.aspx) in the page_load there are no values.count in the Page.RouteData. Page.RouteData.Values.Count == 0 I have another page in the same site with this info matched to it: routes.MapPageRoute("{Location}/{ZipCode}/{Name}/{LocID}/{ID}/{Code}/"