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
0 answers
10 views

How to add dynamic subdomain to site test.mysite.com

I have requirement to manage dynamic subdomains for site like test.mysite.com BTW my current IIS has already multiple site hosted and each has SSL certificate configured. What I want to achieve is any ...
user avatar
0 votes
1 answer
22 views

Regex to remove certain patterns from urls

So i've tried this multiple times but to no avail. Basically, what I am trying to do is check if the URL has a certain language locale and remove it and do a 301 redirect to the parent url without the ...
user avatar
0 votes
0 answers
21 views

NGINX should not change the URL in the Browser Address Bar

I hope you can help me on the following matter. I have NGINX Running and want to forward to .html (virtual pages) to index.php?view=$args without changing the URL, which is shown in the Browser ...
user avatar
0 votes
0 answers
21 views

IIS Redirects to multiple subfolders then errors when I use different rule name

I have a very strange issue which I couldn't figure out. In the IIS under URL rewrite module I have a redirect rule, which works absolutely fine when it is under a specific rule name, however, when I ...
user avatar
0 votes
0 answers
16 views

Issues with NGINX Rewrite Rules

i tried it now several times but it won't work. I have a Server which running Debian 10 with NGINX and Wordpress installed. Now i need to rewrite some old URLs to the new place. We must rewrite URLs ...
user avatar
0 votes
0 answers
16 views

nginx proxy_pass change target domain in requests and responses

My Problem is: I have a server with an internal domain name service.internal.example.com which redirects all clients asking for another domain to its FQDN https://service.internal.example.com. This ...
user avatar
  • 1
0 votes
1 answer
28 views

Nginx Redict without modifying url

I want to make a redirection from one domain to another but from one page only. Example: https://domainA.com/site/page to https://domainB.com/site/page In nginx I put: location /site { ...
user avatar
0 votes
0 answers
23 views

Language directory rewrite to root Wordpress

I am trying to achieve following: I have language directories eg. mysite.com/en/ mysite.com/th/ and so on. I want main site/files from root directory will be diplayed when someone enters mysite.com/en/...
user avatar
  • 1
1 vote
1 answer
22 views

On Apache how to switch off DirectorySlash only for requests to a specific subdomain?

Served by Apache I'd like on one subdomain site of mine (say sub.mydomain.com) that URLs without trailing slashes point directly (without external redirect) to the index file in the underlying folder. ...
user avatar
  • 111
1 vote
1 answer
135 views

Trying to get Apache to serve webp instead of png/jpg (from /img folder of prestashop)

First post here, so I hope I did it well. I converted all png/jpg starting from my prestashop public_html folder to webp, and added rewrite rules to the .htaccess in order to have the webp served ...
user avatar
  • 13
0 votes
1 answer
39 views

nginx reverse proxy IP_adr/1881 to localhost:1881 proxy_pass

I have read this post, and try many thing but i have issue with rewrite regex. here I have many node.js processes as backends with always different port to access. With Nginx reverse proxy in the same ...
user avatar
1 vote
0 answers
222 views

My IIS URL Rewrite rule is not working for my IIS website

I have an IIS Server on Windows Server 2016 where I host one website. The site is using bindings so that both of these domains, astro.resources.teams.org and astronomyteams.org, goto to the same ...
user avatar
0 votes
0 answers
15 views

How to redirect a specific list of webpages to a subdirectory

I am moving some blog articles from the root directory to a subdirectory named blog/. How do I configure Nginx to permanently redirect a specific list of web pages to that subdirectory? Of course, I ...
user avatar
  • 103
0 votes
1 answer
60 views

rewrite rules from apache to nginx

I have a problem with this... I'm using free hosting for giving a demo to my future buyers of my own cms. The hosting is hubuhost.com, they are supporting the last version of php 8.1. The problem is ...
user avatar
  • 3
0 votes
1 answer
68 views

Nginx ingress - escape characters

I have the following ingress conf that is exposed via nodePort 32100. When I call (curl) the URL [1] which contains parenthesis, I get HTTP 500 error. But when I call the URL [2] which contains no ...
user avatar
0 votes
0 answers
26 views

rewrite rule nginx for everything in a domain

I'd like to make a rewrite of my domain name.domain.tld to another URL. I managed to do this but if I type name.domain.tld/dashboard or anything after the tld I still get the content like without the ...
user avatar
0 votes
0 answers
12 views

Cannot GET/ Objects once domain name is enabled

By enabling sub domain to my public IP am not getting the GET respone from my backend. In my local machine once i type the URL http://35.22.12.94:3001/objects?design=ficco-desings&category=formals&...
user avatar
0 votes
1 answer
31 views

nginx - Attempt to redirect path with variable internally fails

i would like to redirect the request to a file from /path/to/file/content?path=file.pdf to /new/path/to/file/file.pdf under the same domain. I tried simple rewrite rules or like this. location ~ ^/...
user avatar
0 votes
1 answer
115 views

Why can I write one set of URLs but not others with NGINX?

I've set up NGINX, version 1.18.0, as reverse proxy for my Apache Superset 1.4.0 installation. I'm trying to capture some URL patterns, and rewrite them by adding standalone=1 at the end. The ...
user avatar
1 vote
1 answer
39 views

Apache http to https WITHOUT any adress?

a normal http to https rewrite could look like this: RewriteEngine On # RewriteCond %{HTTP_HOST} !^example.com$ # RewriteRule /.* https://example.com/ [R] but this code specifies the site to "...
user avatar
0 votes
1 answer
67 views

Rewriting URLs with htaccess for multiple parameters

I'm trying to rewrite this: https://mywebsite.com/pages/article.html?id=1&title=Title-Goes-Here into https://mywebsite.com/pages/article/1/Title-Goes-Here Using this Rewrite Rule RewriteEngine ...
user avatar
0 votes
2 answers
132 views

Htaccess to rewrite URL with two parameters

I want to rewrite this type of URL https://mywebsite.com/content/page.html?id=12&title=my-page-title to https://mywebsite.com/12/my-page-title.html Using generateit.net/mod-rewrite/ I got the ...
user avatar
0 votes
1 answer
189 views

Redirect causes 404 error on nginx

How do I redirect if a user tries to direct access image files in browser only? I want to still keep the ability to allow social media sites to embed our images by hotlinking. I just want only if a ...
user avatar
0 votes
0 answers
38 views

Bad nginx URI redirection

I am trying to authenticate in a keycloak server however the redirect_uri doesnt come with the context (/admin/). Nginx is producing a wrong URI redirect_uri: hxxps://***.pt/auth/realms/example/...
user avatar
  • 121
0 votes
0 answers
19 views

haproxy regrep usage to insert to path

I have a haproxy service running on localhost:8090 with a backend service running on localhost:8080 and I want to transform GET request such as: curl http://127.0.0.1:8090/api/v1/pods (received by ...
user avatar
0 votes
0 answers
25 views

I just transfered domain name and now within my .htaccess file I have two codes which seem the same should one be deleted?

RewriteEngine On RewriteCond %{HTTP_HOST} lagiraudiere\.com [NC] RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.lagiraudiere.com/$1 [R,L] and this one RewriteEngine On RewriteCond %{...
user avatar
0 votes
1 answer
68 views

How to redirect user if direct access image files by browser? [nginx]

How do I redirect if a user tries to direct access image files in browser only? I want to keep the ability to embed images with <img src="...">. How to redirect from https://img....
user avatar
0 votes
0 answers
10 views

Permanent redirect URL in uppercase to lowercase using htaccess [duplicate]

I have the URLs in large letters and I need a permanent redirect to small letters. http://localhost/test/en/Ads-1-Alsace-Bas-Rhin-Cars-Demo01-Particular Redirect to: http://localhost/test/en/ads-1-...
user avatar
1 vote
0 answers
30 views

When the ".php" at the end of PHP Files is removed, it becomes 302 redirect

I remove the .php file attachment in the application, but this time the application's action pages do not work. Because I removed the .php suffix at the end of the files. For example, I want to send ...
user avatar
  • 151
4 votes
1 answer
245 views

use "rewrite" and "try_files" together [Nginx]

I removed the ".php" suffix at the end of the PHP files on the Nginx server with the following code, but this time I cannot send some data to the server. try_files $uri/ $uri.html $uri.php$...
user avatar
  • 151
0 votes
0 answers
35 views

"rewrite" structure for subdomain on Nginx

I want to do a custom rewrite for the subdomain on ISPconfig. When I add the code below for this, the subdomain is redirected to the main domain. Sample #1: server { ... if ($http_host = "...
user avatar
  • 151
2 votes
1 answer
110 views

Why the redirection in .htaccess not work?

I have a Wordpress website. I want to redirect .php urls to the ones without the .php suffix. The .htaccess is as follows: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On ...
user avatar
  • 133
0 votes
0 answers
73 views

Nginx configuration for matching wildcard server_name to specific Symfony route

i have a Symfony 5 application at domain.tld with this basic nginx configuration: map "$http_cloudfront_forwarded_proto:$http_x_forwarded_proto" $cloudfront_proto { default "http&...
user avatar
0 votes
0 answers
153 views

nginx reverse proxy doesn't work with POST request returning 404 error

nginx reverse proxy doesn't work with POST request returning 404 error the rule is location /mio-bff { rewrite ^/mio-bff(.*)$ $1/ break; proxy_pass http://mio-bff.cl-milugar:80; ...
user avatar
1 vote
0 answers
218 views

IIS ARR 3.0 - Change Base Url in Web API Response body using Url Rewrite

I have a local IIS server hosting Asp.net Core 3.1 web API running at port 5000. Using wireguard the local server is connected with the public facing server. The public facing server also has IIS 10 ...
user avatar
0 votes
0 answers
45 views

HAPROXY - redirect URL and keep the same URI

Im using haproxy to do redirections. Basically I have a URL ( https://google.com// ) and I want to keep the same URI and just redirect only the base url ( https://test.com//). For HAPROXY it has to be ...
user avatar
  • 73
0 votes
0 answers
34 views

nginx rewrite rules: Rewrite https://Frontend/backend/Api/SelectAllBranch/ to https://Backend/Api/SelectAllBranch/ or .../SelectAllBranch

I'm using this configuration to nginx proxy reverso location /backend { rewrite ^/backend(.*)$ $1/ break; proxy_pass http://credentials-web-bff.cl-milugar:5000; proxy_redirect off; ...
user avatar
0 votes
1 answer
284 views

How to replace an url part through htaccess

As I am not able to change my URLs through my application, I try to just rewrite the URLs via .htaccess. I try to change my URLs from: https://example.com/mietgeraete_cat/stuffa/ To: https://example....
user avatar
  • 101
1 vote
1 answer
59 views

Two different rewrite conditions in the same .htaccess?

I need to create a rewrite condition for two specific files, according to the requested path in the URL. It's possible? Condition 1: If the URL is example.com/admin go to admin.php?uri=params. That is:...
user avatar
1 vote
1 answer
83 views

Exclude google doc embed iframe from nginx rewrite rule?

I hope that someone can help me here as I have very limited knowledge about server related stuff. I have a WordPress site where I want to limit the /wp-content/uploads/ directory access to logged in ...
user avatar
  • 11
0 votes
1 answer
118 views

NGINX rewrite URL on wordpress but getting 404

I have a WordPress website where my URLs are currently written as follows http://example.com/for-sale/12345-aaa-123-street-bbb-city/ and I would like to still serve the same URL, but I want the URL ...
user avatar
  • 1
0 votes
0 answers
46 views

HTTP to HTTPS Redirection for Server Alias

I have two sites; myFirstSite.123 and mySecondSite.456 and using the Server Alias to redirect accordingly. There two conf file on my Ubuntu Apache server as follows; It works for myFirstSite.123 ...
user avatar
  • 123
0 votes
1 answer
123 views

NGINX Rewrite Rule for Slug [duplicate]

I am trying to create a rewrite rule in NGINX for a URL. The Original URL format is https://example.com/blog/article-slug-here but needs to be in this format: https://example.com/blog?article=article-...
user avatar
0 votes
0 answers
43 views

Disable URL decoding in certain urls KEMP Load Balancer

So I recently set up GitLab in my server and I use the kemp load balancer to reverse proxy and also manage other rules and stuff but today I noticed that the web IDE wasn't working and after looking ...
user avatar
  • 119
0 votes
1 answer
97 views

IIS websites in subdirectory => HTML source requests to root "/" points to default website instead of subdirectory

Our IIS hosts our own website. But recently we have been tasked with hosting a third party website built using Laravel in a subdirectory. The website is loading, but most of the resources like CSS and ...
user avatar
  • 111
0 votes
1 answer
355 views

Using a part of the URI as a port number for nginx proxy_pass directive

This is my nginx configuration : server { listen 443 ssl; server_name sub.example.fr ; location ~ ^/ (123[0-9])$ { # regex work #rewrite ^/[0-9]{4}(.*)$ $1 last;...
user avatar
  • 103
0 votes
0 answers
66 views

Nginx configure location rewrite for all subfolders

This question follows on in many ways from a previous one I had asked - and ended up answering myself. A brief summary of the problem I describe there and my solution to it I need to perform ...
user avatar
  • 173
0 votes
0 answers
51 views

URL Redirect does not work when pattern matches part of the redirect url

I want the wildcard pattern “mysuburl*” to redirect to “http://localhost/mysuburl.html” although I get a too many redirects error. The redirect is successful though if I use a pattern that differs in ...
user avatar
0 votes
0 answers
53 views

Removing folder directories from a URL using Nginx

I am using YetiShare PHP Script I want to change this /plugins/rewards/site/rewards.php to /rewards.php or /rewards I have searched and tried all possible solutions on here and elsewhere to no ...
user avatar
  • 1
2 votes
1 answer
386 views

Apache .htaccess rewrite rules to NGINX converted rules not effective

I'm running a website "PHP script" on aaPanel with Debian 10 installed. All works ok but the images are not showing/broken The /image/ path is a rewrite rule, and it resolves to image.php ...
user avatar

1
2 3 4 5
42