Questions tagged [rewrite]

URL Rewriting maps an incoming URL to a modified URL, so that the request is processes as if the original request was made to the modified URL. This is often used to provide more search engine friendly URLs.

Filter by
Sorted by
Tagged with
0
votes
1answer
15 views

Exception in Nginx sub_filter

I want to use the Nginx sub_filter module and I want to except some files to substitute. Is there a good and clean solution for that? For example, I want to replace str_1 to str_2 in all javascripts, ...
-1
votes
1answer
11 views

Nginx rewrite rule with permanent and last flags

Is it possible to use multiple flags in one Nginx rewrite rule, like permanent+last ?
1
vote
1answer
24 views

IIS loading image resources fails using non-standard Port

I have a PHP web application hosted in IIS. The problem I have is that some image resources can't be loaded because I'm using a non-standard port 81. But in developer tools I can see that the GET ...
0
votes
0answers
10 views

Nginx redirect old site to new site

We have migrated an old site and while the domain remains the same, there are hundreds of old URLs from the old site that have SEO value that we want to keep and redirect to the new site. The new ...
-1
votes
0answers
18 views

How to redirect pages in shared Windows hosting environment?

I have a plain HTML site, and would like to allow some additional parameters to be passed like: example.com/index.html/name example.com/index.html/age example.com/info.html/name example.com/info....
1
vote
1answer
37 views

Serve website from different directory based on URL string parameter

I would like to learn if I can serve the website from 2 different versions according to URL string parameters. Example: I have two installs on my server: example.com/website-1/ and example.com/...
1
vote
1answer
17 views

Rewrite index page requests to a subdirectory and it's pages

I have a XenForo forum, which powers the site. I also have a WordPress install in a subdirectory in XF. This is a must to get an addon called XPress to work so I can integrate both. The issue is that ...
0
votes
1answer
41 views

nginx, wrong MIME type after rewrite removing file extension

I have a storage where files are stored with filename corresponding to their MD5 hash. The files are stored like this: ... /srv/storage/25/ /srv/storage/25/25D6D1AD130E4EB7D11F6AB48C09414E ... /srv/...
0
votes
0answers
11 views

Debugging Nginx map URL rewrites

Nginx in use: 1.16.1 I am trying to use map directive to rewrite (among other things) like this: /file/files/anything.html -> /file/anything.html (in fact any file, not only .html) Map entry: ~/...
0
votes
0answers
6 views

Monitor performance of IIS UrlRewrite Extensibility Sample SQL Custom Rewrite Provider

I've implemented the SQL provider from IIS UrlRewrite Extensibility Samples and it seems to work well, but I'm wondering about the performance impact of IIS calling a stored procedure on an Azure SQL ...
1
vote
2answers
66 views

RewriteRule (Reverse Proxy) of front page in htaccess not working

The following rule should target my front page (WordPress) to serve a different page instead. RewriteCond %{HTTP_HOST} ^example.com$ RewriteCond %{REQUEST_URI} ^($|\/$|\?|\/\?) RewriteRule ^(.*) ...
0
votes
1answer
20 views

End of url and nginx rewrite rule

I'm using following nginx rewrite rule and I don't understand why next results. server { server_name old.example.com; listen 80; listen [::]:80; rewrite ^/.*-f(\d+)/.*-t(\d+)\.html$ ...
0
votes
0answers
37 views

Apache rewrite rule to match hex encoded unicode characters in filenames

Long story short - an user zip restored a bunch of files which contain unicode characters, then deleted the zip. The filenames now have the unicodes with some kind of hex encoding, which of course ...
1
vote
0answers
16 views

nginx rewrite excluding specifc location or directory

According to documentation, Nginx is not flexible for NOT matching a regular expression. How to rewrite and remove .php extension except specific location or directory ? Rules to rewrite and redirect ...
0
votes
0answers
13 views

nginx rewrite rule for php for this /article?id=2 to get this /article/2

I have php7.4 with nginx on ubuntu 18.04 server. I want to rewrite https://example.com/article?id=2 to https://example.com/article/2 using the nginx rewrite rule. Can anyone guide me on how do I ...
0
votes
0answers
15 views

Can Rewrite/Proxy do this with the request send to backend in Apache

I have a website behind Apache. The end users access the website via http://website.com. Admins access the same website via http://admin.website.com, however the backend can only support one domain. ...
0
votes
1answer
10 views

Simple Nginx rewrite resulting in 404

I'm trying to setup a simple rewrite rule on Nginx and it keeps returning a 404, regardless of what I do: server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; ...
0
votes
0answers
37 views

Nginx Rewrite URL to Lowercase and Redirection

I am facing two issues. First, URLs like www.example.com/new-arrivalS which include a character like hyphen are not triggering on the following rewrite. Second, URLs like www.example.com/dealS?p=2 ...
2
votes
1answer
77 views

IIS rewrite rule to black-hole URL's with an apostrophe

I bought a web app that does not use special characters. In reviewing my logs, I am seeing probing by threat actors who attempt to see if my site is vulnerable to SQL injection by adding apostrophes ...
1
vote
2answers
67 views

if I use imperva CDN - can I avoid re-writing the URLs in my site? how does it work?

I understand that part of onboarding a CDN is re-writing all links to static content in my site from www.example.com/my_img.jpg to www.somecdn.com/my_img.jpg. I learned that from How do CDNs that don&...
0
votes
1answer
39 views

Where does RewriteCond %{HTTP_HOST} refer to?

I keep seeing website redirection have something like below: RewriteCond %{HTTP_HOST} But where does the HTTP_HOST refer to? Is it referring to the configuration in some files or the CNAME or ...
0
votes
0answers
13 views

Set a redirect in Apache to render folder static files instead of html file

I have been following this tutorial here to install swagger on my project. I created a folder with the static js/css files along with the index.html file and added .dist folder to the folder. I got to ...
0
votes
2answers
87 views

How to pass secret in rewriterule to AJP protocol

I have a Apache server running 2.4.6, Tomcat 8.5.33 running lucee. We have rewrite rules that proxy to AJP on port 8009. ProxyPassReverse / ajp://localhost:8009/ timeout=3600 RewriteEngine On # ...
0
votes
0answers
99 views

IIS 10 how do I remove internal IP address from response headers

IIS 10 on Windows Server 2016. All current patches are installed. A recent PCI scan claims that the internal IP address of the server is being leaked in HTTP headers. Unfortunately, this scanning ...
1
vote
1answer
55 views

IIS URL Rewrite rule test pattern error: The input data to test does not match the pattern

I am using this as a guide to work on an IIS Rewrite Rule: https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module Sorry - also asked on ...
0
votes
1answer
71 views

nginx mask or convert query string to different url

I want to convert or mask a url with query string to another url. From: https://www.example.com/world/web/?q=hello To: https://www.example.com/world/web/search/hello I have tried everything on ...
0
votes
0answers
22 views

How to count the number PDF downloads using PHP on an NGINX server - conversion of Apache Rewrite Rule

I found excellent rewrite rules and a PHP script that works with Apache to count the number of downloads for certain file types. I need this converted to be NGINX friendly. The Apache rewrite rules ...
0
votes
0answers
23 views

Rewrite URL with nginx

Well, I'm using Ngix as reverse proxy and wso2 in backend. What I want to do is: access wso2's pages using a custom url on NGIX, but acessing the right URL on backend. Example when I access https://...
0
votes
1answer
43 views

Why does my Apache rewrite rule to redirect http to https not work?

I'm trying to have a common rewrite rule so that all http traffic gets rerouted to https. The following is sitting loose in the configuration RewriteEngine On RewriteCond %{HTTPS} off ...
0
votes
0answers
16 views

nginx Subdirectory config to work JS (apache work good, nginx HELP)

I have a some site with work on JS library and path to JS files need to start with ./ (like ./js/somescript.js or ../js/somescript.js) and URL of pages like mydomain.com/lk/welcome but I need make ...
0
votes
1answer
80 views

Nginx url Rewrite (help)

Anyone tell me how to rewrite URL in Nginx https://dl.expamledomain.com/download.php?p=524&st=mmmnGreUwmpRTGl7RO9NtGLhgQZrQ1IW&fn=file.zip to https://dl.expamledomain.com/dwn/524/...
0
votes
0answers
73 views

I can't get the URL Rewrite Module to work

How to redirect in iis URL Rewrite Module this pattern: https://www.example.com/muebles/muebles-de-dormitorio/cama-cucheta-mosconi-gabinete-triliche-caoba-blanca-5536.html or this https://www....
0
votes
0answers
12 views

nginx variable for logging that has the rewrite destination

I have 301 hits going to the access log, but I am looking for a way to include the destination, or "Location" as it is in the http response header, to the access log. I have looked at all the ...
1
vote
1answer
21 views

apache mod rewrite - initial URL equal rewritten URL

I have rewrite rules and get many logs like: [Thu Mar 26 11:41:00.356526 2020] [rewrite:trace1] [pid 18095] mod_rewrite.c(483): [client xy.xy.220.72:56702] xy.xt.220.72 - - [app.xyz.com/sid#...
1
vote
1answer
54 views

nginx - how to redirect depending on a range of IP addresses?

I am trying to make a site only accessible from within the local network and people from the external network will get a static page saying some other message. This is what I am trying to do but it ...
0
votes
0answers
25 views

Awstats tool : issue with missing icons and histogram bars on main page of Awstats - probably an issue of path defined into Apache

I transfer here my original post. I meet difficulties to make appear with awstats tool (CGI script), icons and associated histogram bars, on one of my website (dubbed here website.com). The issue is ...
0
votes
0answers
11 views

How to rewrite a POST request getting some specif parameter to call a GET localhost request changing URL

I'm trying rewrite a POST request getting some specif parameter to call a GET localhost request changing URL. Here what I trying to do: server { listen 80; server_name alias.domain.com; ...
1
vote
1answer
58 views

Nginx rewrite server name rule

If I want to do a rewite rule on nginx : Visit http://*1.abc.com * = any single character will 301 redirect http//*9.abc.com so I created the following config : server { listen 80 ; ...
0
votes
0answers
30 views

Rewrite rule to remove fbclid parameter

I could really use some help creating a rewrite rule to remove the fbclid parameter from links to our website in Facebook posts. We need: https://example.com/blogs/article.cfm?aid=5964&lid=47&...
0
votes
1answer
82 views

Is it possible to use nginx to proxy and rewrite domain names?

Due to the Corona situation all our campuses are closed and we try to find ways to let our students access external library services with ip-range restrictions. We want to have something like this on ...
0
votes
1answer
527 views

IIS URL Rewrite - Redirect root to subfolder

I want: http://somesite.com to redirect to http://somesite.com/subfolder Seems like a pretty simple request. I've followed the sources online, and they all indicate I should use ^$ for the regex ...
0
votes
0answers
21 views

Rewriting “/” links in Knox for kafka-manager?

I'm porting kafka-manager as a Knox service and I have a problem in the rewrite rules for . The following rules works, however it is also applying to "#" and empty string "" <rule dir="OUT" name="...
0
votes
0answers
40 views

Nginx url rewrite part of image name

(disclaimer: I checked before asking this question but couldn't find an anwser) In Nginx, I'm trying to rewrite this kind of image url so : /img/products/us777.gif becomes : /img/products/big-...
0
votes
1answer
82 views

.htaccess to nginx rules

I've read lots of threads here and in other community forums, also tried some htaccess to nginx generators, but I'm struck with this. Thats my .htaccess <IfModule mod_rewrite.c> ...
0
votes
0answers
14 views

nginx proxy pass and conditional url rewrite

i am using nginx to proxy pass to a downstream server to serve a SPA website i need to route requests as follows -- staging.mysite.com/assets/anything to http://localhost:8500/bzz:/8331/staging....
0
votes
1answer
93 views

Apache htaccess multiple %{REQUEST_URI} and multiple %{REMOTE_ADDR}

Can someone help me make this functional? The goal is to provide a list of blacklisted paths ({REQUEST_URI}) and a list of whitelisted IPs ({REMOTE_ADDR}) and block accordingly. Currently the below ...
0
votes
1answer
15 views

rewrite rule losing destination formatting

I have stumbled into the world of Apache webservers primarily to have a friendly internal host name for the number of servers running web pages, this has worked fine by repeating the same steps until ...
0
votes
0answers
27 views

NLB, ARR, IIS Server Farm Website Bindings

I've setup a server farm as follows: ARRSvr1 (ip:192.168.1.30) Roles: IIS, ARR, DFSR, NLB (With Converged IP: 192.168.1.32) ARRSvr2 (ip:192.168.1.31) Roles: IIS, ARR, DFSR, NLB (With Converged IP: ...
0
votes
0answers
9 views

Subdomain Rewrite Windows IIS

There's a way to point all my subdomains to the same name folder, using Windows Server | IIS - Rewrite Rule or Proxy? Example: subdomain1.domain.com ----> C:\customers\development\subdomain1 ...
-1
votes
3answers
273 views

How can i do a redirect with 404 as status code in Nginx [closed]

We have moved our website to a new domain and our SEO department want to have some redirect from the old urls to the new urls with 404 status code. I dont know if it is possible and want to collect ...

1
2 3 4 5
39