url-rewriting

How to hide the URL change when using apache rewrite?

孤者浪人 提交于 2019-12-22 04:19:07
问题 How do I hide the URL change when using an apache rewrite? I have searched for hours on this issue and have decided to come here to find out the answer. So any help/clues would be greatly appreciated! Right now I am using: RewriteRule ^/Page/(.*)$ http://domain.com/page.cfm?pagevar=$1 [NC,L] The problem with that is, when you go navigate to http://domain.com/Page/abc123 it works. BUT, it changes the browser url to http://domain.com/page.cfm?pagevar=abc123 , I want it to perform that same

Adding title to rails route

我只是一个虾纸丫 提交于 2019-12-22 01:16:39
问题 I have List objects which are shown like this: www.mysite.com/lists/123 Where 123 is the id of the list. What I would like to do is add the title of the list the url so it it more informative(for google or whatever). So I would like it to look like: www.mysite.com/lists/123/title-of-list-number-123 How do you go about adding to a url like this? If you just enter: www.mysite.com/lists/123 w/o the title, should it find the title and then redirect to a new route? 回答1: If you want to keep your

Lighttpd configuration, . (dots) in my query string cause 404

房东的猫 提交于 2019-12-21 23:47:18
问题 I have an address on my site like so: http://www.example.com/lookup?q=http%3A%2F%2Fgigaom.com%2F2010%2F10%2F10%2Fangry-birds-for-windows7-phone-dont-count-on-it%2F In this example, the dot in the 'gigaom.com' part of the query string is screwing with lighttpd and my rewrite rules. I get a 404 with the dot in, no 404 if I take the dot out. My rewrite rules are below. In case it makes a difference, I'm using symfony 1.4. If anyone could shed some light on this problem it would be much

Why does htaccess RewriteRule ^foo$ also match ^foobar$

纵然是瞬间 提交于 2019-12-21 23:32:47
问题 I want these URL redirects / forwards: here.com/foo ==> there.com/a/b here.com/foobar ==> there.com/c/d I have these two .htaccess RewriteRule lines: RewriteRule ^foo$ http://there.com/a/b [R=301,L] RewriteRule ^foobar$ http://there.com/c/d [R=301,L] But the result is: here.com/foo ==> there.com/a/b here.com/foobar ==> there.com/a/b foo is also matching foobar How do I make it work? 回答1: This was a browser caching issue. I initially had the rules wrong. I changed the rules to those listed

Web.config URL rewrite - force www prefix and https

隐身守侯 提交于 2019-12-21 22:50:20
问题 I'm trying to enforce https and a www prefix. However my rule doesn't fully work. Here is my rule: <rewrite> <rules> <clear /> <rule name="Force https" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTPS}" pattern="off" ignoreCase="true" /> </conditions> <action type="Redirect" url="https://www.mydomain.co.uk/{R:1}" redirectType="Permanent" /> </rule> <rule name="Force www" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTP_HOST}" pattern=

How to serve precompressed gzip/brotli files with .htaccess

让人想犯罪 __ 提交于 2019-12-21 22:01:52
问题 Im trying to serve precompressed gzip/brotli files for html, js and css. With the following code. RewriteEngine on # Brotli # If the web browser accept brotli encoding… RewriteCond %{HTTP:Accept-encoding} br # …and the web browser is fetching a probably pre-compressed file… RewriteCond %{REQUEST_URI} .*\.(css|html|js) # …and a matching pre-compressed file exists… RewriteCond %{REQUEST_FILENAME}.br -s # …then rewrite the request to deliver the brotli file RewriteRule ^(.+) $1.br # For each

URLRewriteFilter HTTP to HTTPS rule returning net::ERR_TOO_MANY_REDIRECTS

你说的曾经没有我的故事 提交于 2019-12-21 21:38:32
问题 I have Tomcat running with URLRewriteFilter behind an EC2 ELB with SSL certs,the ELB is redirecting traffic from ports 80 and 443 to port 8080 in the backend instances. URLRewriteFilter has this rule: <rule> <condition type="scheme" operator="notequal">https</condition> <condition name="host" operator="equal">ELB-DNS</condition> <from>^/(.*)</from> <to type="permanent-redirect">https://ELB-DNS/$1</to> </rule> but when I try hitting it, I got this: Error 310 (net::ERR_TOO_MANY_REDIRECTS):

How to remove the www. prefix in ASP.NET MVC

[亡魂溺海] 提交于 2019-12-21 20:57:32
问题 How do I remove the www. from incoming requests? Do I need to setup a 301 redirect or simply just rewrite the path? Either way, what's the best way to do it? Thanks! 回答1: I believe it would be more appropriate to do that with IIS' URL rewriting module. If you have access to IIS' management tool, there's a GUI to set up rewrite rules, in the "IIS" section of your site's settings. If you choose "Add Rule(s)..." from there (in the right column menu), choose the "Canonical domain name" rule in

Forcing HTTPS and avoid duplicate URLS using IIS7 URL Rewrite Module

有些话、适合烂在心里 提交于 2019-12-21 20:13:14
问题 I need to force every request to https://www.mysite.com (always with https and www) The site is hosted in GoDaddy and I need to do it via IIS7 URL Rewrite Module. I've been able to do the HTTPS redirect with the following code: <system.webServer> <rewrite> <rules> <rule name="Canonical Host Name" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTP_HOST}" pattern="^mysite\.com$" /> </conditions> <action type="Redirect" url="https://www.mysite.com/{R:1}" redirectType=

Redirect additional domains to main .com domain using IIS7 URL Rewrite Module

烂漫一生 提交于 2019-12-21 19:45:32
问题 How should I configure the URL Rewrite Rule in IIS7 to redirect my aditional domains ( domain.net, domain.org, domain.info) to the principal .com domain? 回答1: In IIS7, you can use the new command “appcmd.exe” to enable redirection as following: %windir%\system32\inetsrv\appcmd set config "Default Web Site/" -section:system.webServer/httpRedirect -enabled:true -destination:"http://domain.com" This tells IIS to redirect all request sending to the virtual application “/” to “http://domain.com”.