friendly-url

Friendly URLs with .htacces weird response form my web hosting… HELP

十年热恋 提交于 2020-01-24 20:56:07
问题 I just wanted that when this is inserted in the URL: http://website.com/pelicula/0221889/ http://website.com/pelicula/0221889/posters/ It really goes to this (in background): http://website.com/index.php?ctrl=pelicula&id=0160399 http://website.com/index.php?ctrl=pelicula&id=0160399&tab=posters So I put this in my .htaccess file: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^/([^/]+)/([^/]+)/?([^/]*)/?$ index.php?ctrl=$1&id=$2&tab=$3 [QSA,L] <

Exception with .htaccess (image broken)

感情迁移 提交于 2020-01-23 17:40:20
问题 I'm using: RewriteRule ^(.*)$ index.php?abrir=$1 RewriteRule ^(.*)/(.*)/(.*)$ index.php?abrir=$1&id=$2&pagina=$3 and I have the image link: /data_livro/capa_livro/af58e898f91509b.jpg How I can add a exception for show the image? Its broke... My full .htaccess: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^/]+)$ index.php?abrir=$1 RewriteRule ^([^/]+)/([^/]+)/([^/]+)$ index.php?abrir=$1&id=$2&pagina=$3 RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L] ErrorDocument 400 index

Rails friendly_id doesn't render on existing user on heroku

こ雲淡風輕ζ 提交于 2020-01-07 08:24:34
问题 I am using the friendly_id gem to make my url friendly & replace id by username in the url for example. Everything works fine under development, because I was about to run (to update currents users url): User.find_each(&:save) in my rails c. But in production mode, on heroku, It works only with new users - How can I add the friendly_id models to existing users ? I tried to run Heroku run rake Pin.find_each(&:save) But without success: -bash: syntax error near unexpected token `(' Any ideas

.htaccess ModReWrite help

杀马特。学长 韩版系。学妹 提交于 2020-01-06 07:58:25
问题 I am having some trouble with my ReWrite code. Please note that the .htaccess file is in the subdomain folder (...public_html/subdomain/ ) I am simply trying to rewrite a page request: http://subdomain.mysite.com/home http://subdomain.mysite.com/index.php?page=home My .htaccess file looks like this... RewriteEngine On RewriteRule ^/([A-Za-z0-9\-\_])$ /index.php?page=$1 Does anything jump out at you? 回答1: Your current rule probably works for urls one character long (after the slash)! Add a +

.htaccess ModReWrite help

删除回忆录丶 提交于 2020-01-06 07:58:09
问题 I am having some trouble with my ReWrite code. Please note that the .htaccess file is in the subdomain folder (...public_html/subdomain/ ) I am simply trying to rewrite a page request: http://subdomain.mysite.com/home http://subdomain.mysite.com/index.php?page=home My .htaccess file looks like this... RewriteEngine On RewriteRule ^/([A-Za-z0-9\-\_])$ /index.php?page=$1 Does anything jump out at you? 回答1: Your current rule probably works for urls one character long (after the slash)! Add a +

Using Rails 5, how can I make FriendlyId append a -“count+1” to duplicate slugs instead of a UUID?

a 夏天 提交于 2020-01-06 07:25:35
问题 Apparently FriendlyId has changed it's previously default method of appending a numeric sequence to duplicate slugs (which is what I want) to now use UUID: Previous versions of FriendlyId appended a numeric sequence to make slugs unique, but this was removed to simplify using FriendlyId in concurrent code. This functionality is not something I'm interested in at this time and would much prefer to have the original method that results in a cleaner URL. I found a similar question where someone

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

痴心易碎 提交于 2020-01-06 07:09:27
问题 "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, and MVC URLs

Disable auto Friendly URLs in a Web Form project

那年仲夏 提交于 2020-01-03 09:11:40
问题 I created a C# web form project in Visual Studio 2013. When I run my sample.aspx page, the page automatically uses the /sample friendly URL routing. I want to handle the routing myself manually and not let .NET to do it automatically. How can I disable the friendly URL feature. I don't want it uninstalled via NuGet, but only disabled in code. 回答1: You could also just set the AutoRedirect mode to Off. This kinda gives you the best of both worlds. public static class RouteConfig { public static

friendly urls for users profile?

限于喜欢 提交于 2020-01-03 05:05:11
问题 hello i wanted to create a format for users url, for example for the user ninja123, he would get a profile link of example.com/ninja123, im using php mysql on apache. this is the normal link! viewprofile.php?userid=2 how could i appraoch this problem? and im a bad .htaccesss newbie :)) thanks 回答1: Instead of doing $_GET['userid'] and looking for ID... switch it by looking for name so it's like: viewprofile.php?userid=Ninja123 Try this Mod Rewrite generator: http://www.generateit.net/mod

How to create SEO friendly paging (in Digg.com style) using ASP.Net 2.0(C#)?

坚强是说给别人听的谎言 提交于 2020-01-03 03:26:04
问题 I have created a digg.com style pagination for my ASP.Net 2.0 (with C#) website's gridview control using this article: http://kpumuk.info/asp-net/gridview-with-custom-digg-like-pager/ In order to achieve digg.com style, the author of the above mentioned article has customized gridview control and created a C# control named as GridviewWithPager using two derived controls (gridview and link button control), which allowed to add Digg-style pagination to an application. But this pagination is not