pretty-urls

How to send get parameters as pretty URL on search form in Laravel?

北城余情 提交于 2021-01-05 07:25:26
问题 I have search form to list properties/ads through certain criteria (city, price, quadrature, property type). I am trying to get pretty url like this for example project/search/city/London/price/1_10000/quadrature/1_150/propertyType/flat instead of this like it is now project/filter?_token=mCwLL58vOxGHtxEBmntPPcks7nV9n3DHXCNKt7hE&city=London&min_price=1&max_price=10000&min_quadrature=1&max_quadrature=150&propertyType=flat&submit= It is my first time to do something like this, and I am

Struts2 better URLs with dot inside

北战南征 提交于 2020-01-03 17:05:09
问题 Let's say we need to get a login form with pre-defined username. So if user goes to url: //somehost:8080/myapp/auth/myusername the action should take myusername as input parameter. I tried http://www.struts2.info/blog/better-urls-with-struts2 as example, and it works great. But if myusername contains dots, like: //somehost:8080/myapp/auth/firstname.lastname , I get 404 error. Is there any simple solution to use dots as a part of url parameter ? 回答1: In struts.xml : <constant name="struts

How to redirect - rewriten urls to short urls

感情迁移 提交于 2019-12-25 01:49:10
问题 I have changed my site url structure. But, Google indexed urls are giving 404 not found error. Now, I need a .htaccess rewrite rule for, From url: www.mydomain.com/topic-titles-here-t273.html To url: www.mydomain.com/sub-folder/topic273.html (Topic id must be cached and topic title must be removed.) Some times, like this also, From url: www.mydomain.com/topic-titles-here-t273-15.html To url: www.mydomain.com/sub-folder/topic273-15.html I searched a lot, for about three hours, But couldn't

how to write pretty URLs without htaccess file in php

混江龙づ霸主 提交于 2019-12-20 07:44:11
问题 Pretty URLs without htaccess I want to write pretty URL like : http://yousite.com/member/1/ instead of http://yousite.com/index.php?page=member&id=1 But i did with htaccess file and now i want to do this without htaccess file because sometimes you don't have permission to edit htaccess file on server. 回答1: If you have an Apache server and AcceptPathInfo is enabled, then you can just use links like /index.php/nice/looking/url. The "index.php" in the middle of the URL might look a little

How to wtite pretty URL in Struts2.x?

白昼怎懂夜的黑 提交于 2019-12-19 12:04:13
问题 I want to rewrite my URL in Struts2. Please help me out to do this. How can i customize as i want, i don't want to show my parameter that i am passing and also show action with different name that i want I don't know how to do it. i have to use plugins for that or configure my code in struts.xml <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <constant name="struts.action.extension" value=

Yii2:-Pretty URL's are formed, but not working (says 404 “NOT FOUND”)

耗尽温柔 提交于 2019-12-18 12:35:54
问题 I have started learning yii2 and I tried to do pretty URL stuff, but failed. What I did:- in config/web.php (I have edited below): 'urlManager' => [ 'class' => 'yii\web\UrlManager', // Hide index.php 'showScriptName' => false, // Use pretty URLs 'enablePrettyUrl' => true, 'rules' => [ ], then I have created a .htaccess file and put it on root (it has below code): RewriteEngine on # if a directory or a file exists, use it directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST

Yii2: Remove controller from URL

醉酒当歌 提交于 2019-12-13 14:16:59
问题 I am using the advanced template. I created all my actions on the SiteController, so all my urls are domain.com/site/something, and I need to remove the word "site" from the url so it will be domain.com/something. I tried the following rules based on this question 'urlManager' => [ 'class' => 'yii\web\UrlManager', 'showScriptName' => false, 'enablePrettyUrl' => true, 'rules' => array( '/<action:\w+>/<id:\d+>' => 'site/<action>', '/<action:\w+>' => 'site/<action>', '/noticia/<slug>' => 'site

htaccess url rewriting, ignoring files

↘锁芯ラ 提交于 2019-12-12 22:32:20
问题 I am trying to come up with a rewrite rule, but I am having problems. What I need - any url that starts with /services/XXX to be redirected to /services/api.php?service=XXX I also want to ignore any files or folders that might also match. What I have so far: RewriteRule ^services/([a-z]+)$ /services/api.php?service=$1 [NC, L] But this does not work at all, it shows a 404 page saying that file is missing when I test it. Any help is much appreciated. 回答1: To ignore the files that exists just

angularjs ngroute with html5mode(true) on apache fails

拟墨画扇 提交于 2019-12-12 00:16:30
问题 I am trying to use ngroute with $locationProvider.html5Mode(true) and a htaccess rewrite, but I can't get it to work. When I try to access for example http://localhost/angular_blog/article/someTitle I get the following error in my console: blogApp.js:1 Uncaught SyntaxError: Unexpected token < blogCtrl.js:1 Uncaught SyntaxError: Unexpected token < angular.js:38 Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.3.15/$injector/modulerr?p0=blogApp&p1=Error%3…gleapis.com%2Fajax

Use htaccess to append a query string to URL

百般思念 提交于 2019-12-11 12:15:22
问题 I need to append query strings to certain URLs for campaign tracking/form submission. so for instance, i need http://domain.com/page/ to redirect to http://domain.com/page/?Campaign_ID=123456 The way i tried to set it up is giving me a redirect loop error message when i try to visit domain.com/page: RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] Redirect 301 /page http://domain.com/page/?Campaign_ID=1234656 I also tried it with RewriteRule instead, and that is also giving me