url-rewriting

How do I use www.domain.org/#!/topic/item style URLs and what are they called?

人走茶凉 提交于 2019-12-05 19:50:54
On many sites I see URLs like www.domain.org/#!/topic/item in my address bar. For example the new twitter changes the URL into that. I know what the hash does when you use targets in HTML: www.domain.org/page.html#topic3 moves the browser viewport to the anchor <a name="topic3"> . Also I think that this URL scheme solves the problem of having always the right URL in the address bar on a page with dynamical loaded content. But how… …do I handle those URLs on the server side? (mod_rewrite, javascript?) …is the technique called? Thanks for your help! The reason why Twitter and some popular sites

how sling rewriter works clarification

北城余情 提交于 2019-12-05 19:46:05
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:Mapping", redirect: { sling:internalRedirect: ["/content/geometrixx/en/$1","/$1"], jcr:primaryType:

mod_rewrite: Check for Custom query string in URL?

杀马特。学长 韩版系。学妹 提交于 2019-12-05 19:40:07
I'm trying to use URL rewrite in my new project. But I also need to allow custom query sting in URL. I just want to know how to write rewrite rule for this URL http://www.mysite.com/edit/123/?q1=value1&q2=value2 to become this http://www.mysite.com/index.php?action=edit&id=123&q1=value1&q2=value2 The custom query string should be allow unlimited. Millions of Thanks... Simply do your rule as any other rule and add the QSA modifier (Query String Append) at the end. RewriteEngine On RewriteRule ^/([A-Za-z0-9]+)/([0-9]+)/$ index.php?action=$1&id=$2 [L,QSA] 来源: https://stackoverflow.com/questions

PHP $_GET var with urlencode and “&” bug

a 夏天 提交于 2019-12-05 19:39:07
In my code, I create a link like this: $link = 'http://www.mydomain.com/'.urlencode($str).'/1'; I use url-rewriting and the rule in my htaccess file looks like this: rewriteRule ^(.+)/(.*)$ index.php?var1=$1&var2=$2 [NC,L] This code is working fine for almost every strings. But sometimes, the string to encode contains "&". The urlencode function encodes it corectly, but when I read the $_GET array in php, it looks like this (with $str = 'substring1&substring2'): 'var1' => 'substring1' (without "&") 'substring2' => '' (without "&") 'var2' => 1 I really need the "&" in my var. Is there a way to

How to rewrite Location response header in a proxy setup with Apache?

时光怂恿深爱的人放手 提交于 2019-12-05 18:15:58
问题 I have a primary proxy which sends requests to a secondary proxy on which OpeenSSO is installed. If the OpenSSO agent determines that the user is not logged in, it raises a 302 redirect to the authentication server and provides the original (encoded) URL that the user requested as a GET parameter in the redirect location header. However, the URL in the GET variable is that of the internal (secondary) proxy server, not the original proxy server. Therefore, I would like to edit/rewrite the

how does URL rewrite work in plain english

孤街醉人 提交于 2019-12-05 17:37:03
I have read a lot about URL rewriting but I still don't get it. I understand that a URL like http://www.example.com/Blog/Posts.php?Year=2006&Month=12&Day=19 can be replaced with a friendlier one like http://www.example.com/Blog/2006/12/19/ and the server code can remain unchanged because there is some filter which transforms the new URL and sends it to the old, but does it replace the URLs in the HTML of the response too? If the server code remains unchanged then it is possible that in my returned HTML code I have links like: http://www.example.com/Blog/Posts.php?Year=2006&Month=12&Day=20 http

What would cause PHP variables to be rewritten by the server?

限于喜欢 提交于 2019-12-05 17:12:06
问题 I was given a VM at my company to install web software on. But I came across a rather bizarre issue where PHP variables would be overwritten (rewritten) by the server if they matched a specific pattern. What could rewrite PHP variables like this? The following is as an entire standalone script. <?php $foo = 'b.domain.com'; echo $foo; // 'dev01.sandbox.b.domain.com' $bar = 'dev01.sandbox.domain.com'; echo $bar; // 'dev01.sandbox.sandbox.domain.com' $var = 'b.domainfoo.com'; echo $var; // 'b

Remove .php and id from url and replace with slash

南楼画角 提交于 2019-12-05 16:12:38
i have tried lots of for url rewrite rules in htaccess but i am stuck now. i have to change this url products.php?id=31 to products/31 i have used Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / ## don't touch /forum URIs RewriteRule ^forums/ - [L,NC] ## hide .php extension snippet # To externally redirect /dir/foo.php to /dir/foo RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC] RewriteRule ^ %1 [R,L] # To internally forward /dir/foo to /dir/foo.php RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.*?)/?$

ASP.NET MVC 3 HttpPost action method not found

泪湿孤枕 提交于 2019-12-05 16:08:06
I have a simple form that posts to an HttpPost action method, which returns its corresponding view. My issue is that I'm getting a 404 Not Found error. Oddly enough, if I change the form method and the attribute on the action method to a GET , then it works and the TestMethod view is displayed. It seems I'm missing something for using POST , but my posts in other controllers work fine (e.g. account login and registration). Note the AllowAnonymous attribute is a custom attribute to be able to specify the controllers or actions that allow anonymous access, as opposed to specifying (via the

Remove “page” from pagination URL

浪尽此生 提交于 2019-12-05 15:24:57
I have problem with changing pagination URL in Wordpress. I know that universal solution for this is to changing Wordpress core files, but I need this solution only for one category. Maybe for only one category this can be done by htaccess? There is now URL like this: http://mysite.com/categoryname/ page /3 and I want change it to this: http://mysite.com/categoryname/3 Thanks for any response You need to match against the %{THE_REQUEST} to ensure that you're matching against the actual request and not an internally rewritten URI: RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /categoryname/page/([0-9