url-rewriting

.htaccess redirect URL to specific pattern

大兔子大兔子 提交于 2020-01-05 08:03:13
问题 Supposing I have some URLs, looking like this: site.com/html/photographers-4.cfm?county=test1 site.com/html/photographers-5.cfm?county=test2&speciality=test3 site.com/html/photographers-9.cfm?address4=test4&county=test5 site.com/html/photographers-10.cfm?county=test6&speciality=test7&address4=test8 where testX (...) may be the same or may differ. How would I be able to rewrite each of these so that the URL will be more eye-catching ? site.com/test1-photographers site.com/test2-tes33

Special characters in mod_rewrite url

只谈情不闲聊 提交于 2020-01-05 07:56:09
问题 I want this URL: http://www.mydomainblabla.com/s/can+you+drill+shrinky+dinks?.html to be rewritten to this one: http://www.mydomainblabla.com/search.php?q=can+you+drill+shrinky+dinks? I am using this mod_rewrite rule in my .htaccess to accomplish this RewriteRule ^s/(.+).html$ search.php?q=$1 [L,QSA] However, the result is not as I want it, when I go to the first url, I get a page not found message. The same problem occurs when I visit this url: http://www.mydomainblabla.com/s/http://www

URL Rewrite - A potentially dangerous Request.Path value was detected from the client

随声附和 提交于 2020-01-05 07:53:05
问题 I have a number of URL rewrite rules in place (they are all listed below). When I browse "http://domain.com" I am forwarded to "http://www.domain.com/R:" with the message of "A potentially dangerous Request.Path value was detected from the client (:)." I want to be able to browse the site without "www" and be forwarded correctly. I am not sure how to update or add to my existing rewrite rules. This is .Net site. I am hoping someone in the community can give me any hints. <rewrite> <rules>

Cannot make Relative Path, Rewrite Rules and Routes behave the way I intended

三世轮回 提交于 2020-01-05 05:56:05
问题 Background I am writing a web project with PHP without framework. I used various packages to write in MVC pattern. For the routing part (I used League/Route), I have to set some rewriting rules on Apache server for the routes to work. The company's server is set up in a way that all application codes sit outside of the document root, and alias is used to internally redirect to the application. This leads to a lot of trouble in terms of relative paths, routes and URL rewriting. I'm going to

Directory rewrite in .htaccess to another directory

自闭症网瘾萝莉.ら 提交于 2020-01-05 03:46:37
问题 I have .htaccess that does this: https://example.com/john shows the contents of the directory https://example.com/user/index.php?username=john RewriteRule ^([a-zA-Z0-9_-]+)$ /user/index.php?username=$1 [QSA] How can I make it so https://example.com/john/blah will show the contents of https://example.com/user/blah ? Only show contents of /user folder if my previous rewrite rule was applied. For example: example.com/john/haha ---> example.com/user/haha example.com/privacy/blah ---> // Will show

htaccess to handle redirect page when url encodeURIComponent

ぃ、小莉子 提交于 2020-01-05 03:43:32
问题 I have a page that uses TinyMCE to update the contents of the web. when I click the button on the form with ajax post method, I get the contents of my url like this (http://vansolusindo.com/demo2/lapakkemasan/test/test.php?v_content=%3Cp%3Etest+update+data%3C% 2Fp% 3E & save = Submit). then immediately redirect to the index page of my website. so it makes no .php file for input to the database. My question, how to handle that my page is not redirect to the index page and enter .php pages to

Why does my rewrite rule disables additional $_GET data?

我的未来我决定 提交于 2020-01-04 13:08:11
问题 I'm using this rewrite rule for my whole domain: RewriteRule ^([A-Za-z0-9/-]+)$ /index.php?path=$1 So for example, my urls look like this: http://www.example.com/page/subpage/4/anything/ The problem is when I want to manually add a specific $_GET , like this: http://www.example.com/page/subpage/4/anything/?also=admin I remember this has worked on some sites I've been developing, but it doesn't work here. How can I fix my RewriteRule so that I can add $_GET data like this? 回答1: Use Query

url rewriting with htaccess? [duplicate]

落爺英雄遲暮 提交于 2020-01-04 11:05:06
问题 This question already has an answer here : rewrite url with htaccess [closed] (1 answer) Closed 5 years ago . My problem: I want to write a .htaccess rule for. www.asdf.com/city.php?city=New-York to www.asdf.com/New-York but also with that I have other pages such as www.asdf.com/country.php?country=USA which I would like to appear as www.asdf.com/USA and www.asdf.com/state.php?country=LA which I would like to appear as www.asdf.com/LA Pretty confused how to do that. 回答1: If you wish to have

url rewriting with htaccess? [duplicate]

痞子三分冷 提交于 2020-01-04 11:04:00
问题 This question already has an answer here : rewrite url with htaccess [closed] (1 answer) Closed 5 years ago . My problem: I want to write a .htaccess rule for. www.asdf.com/city.php?city=New-York to www.asdf.com/New-York but also with that I have other pages such as www.asdf.com/country.php?country=USA which I would like to appear as www.asdf.com/USA and www.asdf.com/state.php?country=LA which I would like to appear as www.asdf.com/LA Pretty confused how to do that. 回答1: If you wish to have

Regex for URL rewrite with optional query string parameters

百般思念 提交于 2020-01-04 10:43:31
问题 I have this rewrite rule: <rule name="rentals by proptype+state+city+street test" stopProcessing="true"> <match url=".*" /> <conditions> <add input="{UNENCODED_URL}" pattern="^/([a-zA-Z0-9\-+]+)/rent/province/([a-zA-Z\-+]+)/street/([a-zA-Z0-9%\-+]+)/([0-9a-zA-Z%\-+']+)$" /> </conditions> <action type="Rewrite" url="search_new.aspx?proptype={C:1}&province={C:2}&city={C:3}&street={C:4}" appendQueryString="true" /> </rule> I also tried: <rule name="rentals by proptype+state+city+street test"