url-rewriting

Yii url manager only ID in url

不羁的心 提交于 2020-01-03 04:24:08
问题 i have in YII for example domain: www.example.com/product-url-1234 how to set rules in urlManager and how to use controller/action/id 回答1: If you want to use this url www.example.eu/product-url-1234 and suppose 'index' is the name of the action of the 'user' controller that will handle the request Then create a rule like '<id:.*?>'=>'user/index' Now if you will use Yii::app()->createUrl('user/index',array('id'=>'product-url-1234')) then it will give you the desired result. And if you Visit

href tags in jsp's and passing data by clicking on href tag

大城市里の小女人 提交于 2020-01-03 03:54:05
问题 this is my program <form method="post"> Movie Name :<input type="text" name="movie"/><br> Hero:<input type="text" name="hero"><br> Director:<input type="text" name="dir"><br> <a href="insert.jsp">Insert</a> <a href="update.jsp">update</a> <a href="delete.jsp">Delete</a> when i click on the any of the href link the values of above text boxes should also to be carried to that particular jsp page i used getparameter method but i am not getting what i entered but they are taking null values 回答1:

Getting the query string when using Tuckey URL Rewrite

早过忘川 提交于 2020-01-03 03:16:23
问题 I have the following rule: <rule> <from>^/users/(.*)$</from> <to last="true">/users.do$1</to> </rule> And I want to match the following url: http://localhost:8077/users/?elemsPerPage=10 and redirect it to: http://localhost:8077/users.do?elemsPerPage=10 The problem is that when the url rewriter engine finds the "?" character in the url it does not return anything else in the $1 matched parameter. Neither it adds the parameters to the query string. Any ideas? 回答1: Finally I've found a way to

.htaccess rule: multiple domains to one ssl domain

烈酒焚心 提交于 2020-01-03 00:56:10
问题 I've tried around getting the following to work for 2 hours now. I have multiple domains such as: Test.Xy.zz Test.Abc.de Test.mmm.mm Now only Test.xy.zz got an ssl certificate and the application running on it is limited to it. Therfor I want all non-ssl requests - including test.xy.zz and all other domains to go to https://test.xy.zz Hope someone can help. Possible solution: RewriteEngine On RewriteCond %{HTTP_HOST} !test\.xy\.zz RewriteRule ^(.*) https://test.xy.zz/$1 [QSA,R=301]

.htaccess url rewrite and removing %20 [duplicate]

时间秒杀一切 提交于 2020-01-02 21:48:32
问题 This question already has an answer here : htaccess rewrite replace space with - (1 answer) Closed 5 years ago . Hi Im very new at the rewriting thing. I have an Apache host that is hosting my website and I need to make the url rewrite to make it just look better than it currently is. So I have this link http://www.kalah.co.za/content.php?page=Civil%20Tactical%20Training and i want it to look like http://www.kalah.co.za/Civil-Tactical-Training.html Now I can do the first bit I guess with this

How to beautify the URL?

痞子三分冷 提交于 2020-01-02 15:47:52
问题 I am sick of this kind of URL: www.domain.com/something/?id=person&photos=photoID&variable1=others&... I am using apache, learning to write .htaccess now. Can anyone show me the basic code for this one? Ugly: www.domain.com/something/?id=person&photos=photoID Goal: www.domain.com/something/person/photoID 回答1: RewriteEngine on RewriteRule ^something/(.*)/(.*)$ something/?id=$1&photos=$2 [QSA] 回答2: This is an extremely helpful article on Mod_Rewrite 来源: https://stackoverflow.com/questions

Allow chinese chracters in url rewriting

白昼怎懂夜的黑 提交于 2020-01-02 10:33:26
问题 I had wrote URL rewrite Rule: <match URL="^([_0-9a-z-]+)/([_0-9a-z-]+)/([_0-9a-z-‘!@#$%^*()!~`\."]+)"/> But there are some Chinese characters in my URL like: 'http://www.ilanbio-international.com/News/4443/中国陕西西安---渭南验室奠基石庆典' Which is not support by this rule. So how can I support Chinese characters through URL rewriting? 回答1: Just add this: <match url="^([_0-9a-z-]+)/([_0-9a-z-]+)/([_0-9a-z-‘!@#$%^*()!~`\."\u4e00-\u9fa5]+)"/> In place of this: <match URL="^([_0-9a-z-]+)/([_0-9a-z-]+)/([_0-9a

how sling rewriter works clarification

我与影子孤独终老i 提交于 2020-01-02 09:30:12
问题 I am trying to understand how sling url rewrite works. I'm following this url - http://www.cognifide.com/blogs/cq/multidomain-cq-mappings-and-apache-configuration/ Steps I've done in publish environment - /etc/map.publish/http: jcr: primaryType: "sling:OrderedFolder", home: { sling:internalRedirect: ["/content/geometrixx/en.html"], jcr:primaryType: "sling:Mapping", sling:match: "localhost:4503/$" }, localhost.4503: { sling:internalRedirect: ["/content/geometrixx/en"], jcr:primaryType: "sling

PHP/Apache REQUEST_URI different behaviour?

半腔热情 提交于 2020-01-02 09:09:51
问题 I am moving websites from one server to another. Both are on a similar variant of Centos 5 x64 with Apache 2.2 and PHP 5.2.X . Some of my scripts ,including Wordpress , are behaving incorrectly. It turns out the issue is the difference between the REQUEST_URI global: On the older server: REQUEST_URI = /phpinfo.php On the new server: REQUEST_URI = http://www.example.com/phpinfo.php I have changed my own code to accommodate either variant but don't really want to do it for Wordpress etc. What

Beginner Apache URL Rewrite Question

别来无恙 提交于 2020-01-02 08:56:11
问题 I'm just trying to figure out if I'm on the right path - additional details on rewriting the URL in my example would be appreciated. I have installed a CMS program and would simply like that www.example.com be pointed to www.example.com/cms. I just want to know if URL rewriting through apache is the best way to accomplish this? Thank you. 回答1: Just redirecting http://example.com/ to http://example.com/cms/: <IfModule mod_rewrite.c> RewriteEngine On RewritRule ^/?$ /cms/ </IfModule>