url-rewriting

Why is my htaccess rule not rewriting the url

不想你离开。 提交于 2019-12-25 10:59:54
问题 Ok so i have this url in my opencart application and it works well http://site.com/index.php?route=information/contact but the clients hates the url and wants http://site.com/contact i figured i could just do this in my htaccess and all would be good but visiting the url i get nothing RewriteRule ^(contact)$ index.php?route=information/contact [L,QSA] any ideas here is my htacess RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^?]*) index

Why is my htaccess rule not rewriting the url

落爺英雄遲暮 提交于 2019-12-25 10:57:16
问题 Ok so i have this url in my opencart application and it works well http://site.com/index.php?route=information/contact but the clients hates the url and wants http://site.com/contact i figured i could just do this in my htaccess and all would be good but visiting the url i get nothing RewriteRule ^(contact)$ index.php?route=information/contact [L,QSA] any ideas here is my htacess RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^?]*) index

Can I route HTTPS requests to HTTP application, using IIS7 ARR?

浪子不回头ぞ 提交于 2019-12-25 10:48:45
问题 I have an application server installed, listening for HTTP traffic on a port which is not blocked from the world by a firewall. I wish to expose the services offered by this application only through HTTPS, preferably as a "sub directory" of the HTTPS site already hosted by the server. Using IIS7 Url Rewriting (as part of the ARR package), I am able to setup a rule that redirects all traffic to a sub path of my existing HTTPS site. However, I am facing some trouble, when trying to make the

Pros/cons of using index.php?q=path/ instead of index.php/path/ when routing URLs?

本小妞迷上赌 提交于 2019-12-25 09:42:39
问题 I'm writing a simple method to map routes to files and I've come across two ways to do it. The first, and I guess used by most frameworks, is using the $_SERVER['REQUEST_URI'] variable to extract everything after index.php: RewriteRule ^(.*)$ index.php [QSA,L] The second way is used in Drupal, and the route is simply passed as a query string. RewriteRule ^(.*)$ index.php?q=$1 [QSA,L] Now, the "Drupal way" seems a lot simpler to me. With the other method you'd have to use "explode" on both $

Replace space with dash (-) in url only

强颜欢笑 提交于 2019-12-25 09:36:16
问题 Is it possible to change the space in the url to a dash (-) without changing it in the code? The URL is used to identify the page, so it is not possible to just change the url because the page will not be found anymore so str_replace is not usable in this solution. Using str_replace twice, once to change the space to dash and on the page-loader to change it back to spaces isn't going to work either, some pages already have a dash in the pagename :) I was hoping this could be achived with

IIS Url Rewrite ARR issue

大憨熊 提交于 2019-12-25 09:24:36
问题 I configured IIS as a reverse proxy using Url Rewrite module and ARR 3. I have a public domain which redirect to my application on localhost. It's working fine excepted when the application redirect to another host. ie: redirecting to "https://www.google.com/search?q=url+rewrite+iis+arr+3" My browser shows "http://localhost/search?q=url+rewrite+iis+arr+3" which fails The hosted application is using Asp Net Mvc with framework.net 4.5. The application is working with integrated pipeline in IIS

In PHP, how to preserve 1st part of a link, keep 2nd and dynamically change the rest

不打扰是莪最后的温柔 提交于 2019-12-25 09:16:27
问题 Foe example. Lets take 4 URLs (existing or future) that follow the targeted pattern of: https://KeepThisPartTill-cde.com/a/b/cde/ThisWillBeDifferent/ThisWillNot https://KeepThisPartTill-cde.com/a/b/cde/ThisIsDifferent/ThisWillNot https://KeepThisPartTill-cde.com/a/b/cde/ChangedAgain/ThisWillNot https://KeepThisPartTill-cde.com/a/b/cde/AndAgain/ThisWillNot So. If any of these (existing or future) links is clicked , we need them to be changed to: https://KeepThisPartTill-cde.com/a/b/cde

Why Twitter's t.co shows up in Referer, but no URL shorteners ever do?

邮差的信 提交于 2019-12-25 09:14:17
问题 I've noticed a whole bunch of Referer links like t.co/oPQO7Xdz in my access_log files, but no other URL shorteners ever show up. Why? 回答1: The URL shorteners never show up because HTTP 301 Moved Permanently et al redirects in HTTP are not designed to influence the Referer HTTP Request Header (apparently, not even if the header is blank, potentially due to the fact that it'll cause inconsistency in behaviour otherwise). However, Twitter does not issue 301 Moved Permanently redirects with its t

Need to display image in ASPX page that has long url

那年仲夏 提交于 2019-12-25 08:57:28
问题 Scenario: Within ASP.NET site, I have an ASPX page where within OnLoad event, I set the imageUrl for one of the image controls. This URL value comes from an external source and the image is not getting displayed and I found out it is because the URL is too long. How to display images of longer URLs? Should I use POST with javascript or any other options to achieve? The values within the URL are crucial and I can't loose some of the parameters. Please suggest. Code in OnLoad event is something

URL Rewrite issues on IIS 7.0 with subdomains, not present on IIS 7.5

◇◆丶佛笑我妖孽 提交于 2019-12-25 08:47:38
问题 i'm building this asp.net application that require couple of subdomains. they will all share the same code base but i have separate .aspx for each subdomain in its own subfolder, as follows: admin.domain.com -> domain.com/admin user.domain.com -> domain.com/user ... everything works great on my dev box (win7, iis 7.5) using the following rewrite rules: <rule name="admin.domain.com" stopProcessing="true"> <match url=".*" /> <conditions> <add input="{HTTP_HOST}" pattern="^admin.domain.com$" />