friendly-url

Friendly Url .htaccess

北城余情 提交于 2019-12-02 05:29:31
I have tried to follow the directions on .htaccess short and friendly url but am unable to achieve these results. If I use the following it works fine: RewriteEngine On RewriteRule ^([^/]*)\.html$ /index.php?page=$1 [L] However if I use: RewriteEngine On RewriteRule ^([^/]*)$ /index.php?page=$1 [L] I receive an internal server error. All I am trying to achieve is to be able to use http://website.com/about instead of http://website.com/about.html These rules: RewriteEngine On RewriteRule ^([^/]*)$ /index.php?page=$1 [L] Is causing an internal rewrite loop. The rewrite engine loops through all

.htaccess RewriteRule not working, need to generate a URL friendly

元气小坏坏 提交于 2019-12-02 04:37:05
I have this dynamic link: http://www.nortedigital.mx/article.php?id=36175&t=dobla_las_manos_el_snte__avala_reforma_educativa and I need to convert in URL friendly like this: http://www.nortedigital.mx/36174/se_enriquecio_elba_en_sexenios_del_pan.html and i have this RewriteRule: RewriteRule ^([^/]*)/([^/]*)\.html$ /article.php?id=$1&t=$2 [L] but doesn't work. Please, anybody can help me? You must capture the query string in a RewriteCond and use that in the RewriteRule RewriteEngine On RewriteCond %{QUERY_STRING} ^id=(\d+)&t=(.+)$ RewriteRule ^/?article\.php$ /%1/%2.html? [R,L] This redirects

Rewrite GET Query String using .htaccess

时光总嘲笑我的痴心妄想 提交于 2019-12-02 02:16:58
I want to Rewrite my GET Query String from this - http://www.example.com/verify.php?key=547b52f2b5d20d258e62de1e27b55c to this http://www.example.com/verify/547b52f2b5d20d258e62de1e27b55c I am using the following rule but it does not seem to work - RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(([A-Za-z0-9\-]+/)*[A-Za-z0-9\-]+)?$ $1.php RewriteRule ^[A-Za-z-]+/([A-Za-z0-9-]+)/?$ verify.php?key=$1 [NC,L] Use the following: RewriteEngine On RewriteCond %{THE_REQUEST} ^GET\ /verify\.php\?key=([^\s&]+) [NC] RewriteRule ^verify\.php$ /verify/

Removing index.php from website URLs

喜欢而已 提交于 2019-12-01 22:45:44
问题 I am using the Kohana framework (but I think it's irrelevant for this question) and pages can be accessed like so http://www.example.com/articles/ http://www.example.com/index.php/articles/ Now, as a rule of thumb, I generally try and tweak my .htaccess to only allow one way in for a page, and silently redirect other common ways. Essentially, in the 1st URL above, the address is actually internally redirected to the 2nd example. What I want to do, is to force any URLs of the 2nd type to turn

Bookmarkable URL in JSF application - Trying to use Spring Webflow and JSF . Any suggestions?

主宰稳场 提交于 2019-12-01 22:21:04
Our application is JSF , hibernate & Spring. Currently the url is in following format http://www.skill-guru.com/skill/login/testDetails.faces?testId=62&testName=PMP-Certification-practice-test We want a clean url like http://www.skill-guru.com/urltitle?some parameter One of the ways we could do this is through integration with Spring webflow with JSF. Any other suggestions ? We are trying Spring webflow 1.0 with JSF 2.0 but that does not seem to work. Bozho PrettyFaces provides beautiful URLs for JSF applications. You can always use the UrlRewriteFilter 来源: https://stackoverflow.com/questions

User friendly URLs - mod rewrite and php redirections

a 夏天 提交于 2019-12-01 18:06:20
So far I've done this: RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?load=$1 [QSA,L] Then on my index page (in the root directory) I'm using PHP to determine which page to load: // Swap to variables $load = $_GET['load']; // Home page if (!$load || $load == "") { include('home.php'); exit(); } // Dashboard if ($load == "dashboard") { include('dashboard.php'); exit(); } // About if ($load == "about") { include('about.php'); exit(); } // Username $data_array = array(':username' => $load); $select_account = $connect->prepare(

User friendly URLs - mod rewrite and php redirections

浪尽此生 提交于 2019-12-01 16:46:43
问题 So far I've done this: RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?load=$1 [QSA,L] Then on my index page (in the root directory) I'm using PHP to determine which page to load: // Swap to variables $load = $_GET['load']; // Home page if (!$load || $load == "") { include('home.php'); exit(); } // Dashboard if ($load == "dashboard") { include('dashboard.php'); exit(); } // About if ($load == "about") { include('about.php');

Grails - Language prefix in url mappings

放肆的年华 提交于 2019-12-01 14:10:09
Hi there im having problem with language mappings. The way i want it to work is that language is encoded in the url like /appname/de/mycontroller/whatever If you go to /appname/mycontroller/action it should check your session and if there is no session pick language based on browser preference and redirect to the language prefixed site. If you have session then it will display english. English does not have en prefix (to make it harder). So i created mappings like this: class UrlMappings { static mappings = { "/$lang/$controller/$action?/$id?"{ constraints { lang(matches:/pl|en/) } } "/$lang

How to reproduce specific Friendly URL?

杀马特。学长 韩版系。学妹 提交于 2019-12-01 13:24:09
we are trying to refactor an JSP/XSLT application to JSF. We use a CMS for content management. Technologies : JSF 2.0 using Mojarra, PrimeFaces 2.2.1 and Tomcat 6.29 The organisation of the data structure is the following: There are Sites. Sites contain Channels. Channels contain Contents. Sites, channels and content are translated. The URLs look like: http://whatever/firstSite http://whatever/firstSite/aChannel http://whatever/firstSite/aChannel/aSubChannel/myGreatContent It's the translated name who is showing to the user. The siteName only appears once, channel can appear many times and the

Friendly URL (mod-rewrite) issue

旧时模样 提交于 2019-12-01 09:45:59
问题 Hallo, I am trying to make "nice" URL, first rule works as expected, it's turning www.blabla.com/index.php?page=tags&tag=blabla into www.blabla.com/tags/blabla but second rules doesn't works? RewriteEngine On RewriteRule ^([^/]*)/([^/]*)$ /index.php?page=$1&tag=$2 [L] RewriteRule ^([^/]*)/([0-9]*)$ /index.php?page=$1&article=$2 [L] Than you 回答1: Since numbers could be considered as anything but a forward slash ( / ), you should put the article rule before the tag rule: RewriteEngine On