Questions tagged [url-rewriting]

0

votes
0

answer
4

Views

Apache http to https rewrite rule not working - but it was this afternoon

I've got a few sites running on my apache server. I have a ssl cert on all of them. Because of this, I have a virtual host * rule that should redirect any http traffic to the related https site. If i try to go to a site right now with http, I get the apache test site... However, if I type in https,...
Brds
0

votes
1

answer
11

Views

IIS Rewrite based on query string value

I am new to IIS Rewrite, Need someone to assist me, I am in a scenario to redirect to another domain based on querystring value. Ex: Request: http://localhost:50743/api/Values?stdId=1000&stdName='Test' http://localhost:50752/api/Values?stdId=1001&stdName='Test1' http://localhost:50753/api/Values?std...
Vicky S
1

votes
1

answer
260

Views

nginx rewrite part of url with ? mark

I'm serving a website with nginx as a proxy for apache. I have a problem with rewrite module. http://example.com/foo/bar/url?someparam=1&otherparam=2 I need to rewrite from /foo/bar/url?someparam=1&otherparam=2 to /foo/bar/url2?someparam=1&otherparam=2 I found it problematic, since it's not /foo/...
Ivan Nikolaev
1

votes
3

answer
57

Views

Is there a way to rewrite my urls without using mod_rewrite and .htaccess?

Is there a way to rewrite my urls from: http://www.website.com/notification.php to http://www.website.com/notification I dont have the permission to turn on mod_rewrite and our organisation doesnt want it either. Is there a way to realise this with php only? Thanks in advance
Khaled Tlili
1

votes
0

answer
444

Views

Reverse proxy with IIS

I'm trying to integrate ASP.net and Node.js on a server. My expectation is here. client ----> IIS Server ----> ASP.NET (except /api/. localhost:80) (test.foo.com) |---> Node.js (starting with /api/. localhost:4000) Node app is executed as a windows service, and serve localhost:4000/api/ in loc...
sungyong
1

votes
0

answer
338

Views

Rewrite URLs on Laravel Homestead

I'm making a web game. The backend is Lumen and the frontend is a single page application. I want to make a use of JavaScript History API, so all URIs (except for actual file or directory paths) should point to the same backend script. I know how to do it on Apache, but my local server is Laravel Ho...
Robo Robok
1

votes
0

answer
100

Views

what is the Best way UrlRewriting in umbraco?

I want to change this http://localhost:65438/vehicle?id=12345 into http://localhost:65438/Make/Model/?id=12345 For this i am using following code for urlrewriting in umbracoUrlRewriting.config But the problem is that it is hitting the page load action of vehicle view continuously after a period of...
Plz Help
1

votes
1

answer
25

Views

.htaccess rewrite causes an endless loop

I have a .htaccess code the rediredt every user on smartphone to a competible website: RewriteEngine On RewriteEngine On RewriteCond %{QUERY_STRING} !^desktop RewriteCond %{HTTP_USER_AGENT} 'android|blackberry|googlebot-mobile|iemobile|iphone|ipod|#opera mobile|palmos|webos' [NC] RewriteRule ^ h...
1

votes
0

answer
204

Views

IIS Rewrite for angular app in a virtual directory

I am trying to build a web api project with an angular front end following this example https://angular.io/guide/visual-studio-2015. In it, it states that you need to configure your web.config with That works fine when my web api project is at www.example.com, but in my IIS setup it needs to be in a...
Dookie67
1

votes
0

answer
33

Views

Angular URL like breadcrumbs

Suppose I have a private online shop made with Angular. Suppose I have products that belong to a group and a category. A product have a unique identifier for all the shop. In order to see a product I can just go to: http://myshop.com/product/c30066efc5ee46278ef9bc27c99977b4 I'm thinking on adding th...
Pablo
1

votes
1

answer
34

Views

How can I catch all routes with apache and html

I write a js script in index.html that parse URL and redirect to a proper destination. e.g it parses example.com/#/info and shows a proper link. I want that it handle any URL such example.com/xyz. but it shows 404 error. when I add .htaccess like this: RewriteEngine on RewriteBase / RewriteCond %{...
paykoob
1

votes
1

answer
50

Views

Username in domain after slash

What is the best way to rewrite the url from https://www.example.com/user/?user=MaxMustermann to https://www.example.com/MaxMustermann I have tried that in the .htaccess-File with a RewriteRule, but if I open the URL exmaple.com/login.php, I get the Message 'User not found', whats correctly. How can...
Daniel Müller
1

votes
0

answer
30

Views

Wordpress rewrite_rule based on subdomain

Is it possible to create rewrite_rules based on subdomain in Wordpress? For example se.domain.eu/page/cat/ = Results in page id 1 dk.domain.eu/page/cat/ = Results in page id 2
Jonas Sturebrand
1

votes
1

answer
61

Views

Rewrite url in nginx config

I want to rewrite url https://www.beecow.info/product/whosaler-san-pham-shop-dang-590-34-390-k-p345954 to https://www.beecow.info/whosaler-san-pham-shop-dang-590-34-390-k-p345954 I want to remove apart /product/ And here is my nginx config server { listen 80; server_name beecow.info; return 30...
Nha Phuong
1

votes
0

answer
205

Views

Yarn / IIS URL rewrite

I have a React app deployed to production as a bundle.js and index.html pair, served up by IIS under a url like: https://my-app.com This talks to a .Net WebAPI backend, served up by IIS as a virtual application at https://my-app.com/api This allows the React app to make requests to the relative url...
Alex McMillan
1

votes
1

answer
458

Views

Nginx configuration for rewrite rule

So I have this configuration at the moment in nginx: autoindex off; location / { try_files $uri $uri.html $uri/ @extensionless-php; index index.html index.htm index.php; } location @extensionless-php { rewrite ^(.*)$ $1.php last; } # pass PHP scripts to FastCGI server # location ~ \.php$ { include s...
Robin
1

votes
0

answer
191

Views

Rewrite folder name from the URL in nginx

Hi I am new to nginx and trying to remove folder name from the URL. Here is how my URL is accessible: localhost/project_name/frontend/dashboard localhost/project_name/frontend/feed I want to remove the folder named 'frontend' from the URL. the folder contains all of my rendering templates. I have u...
Hammad
1

votes
1

answer
63

Views

Premanently redirect .php or .aspx to an extensionless asp.net MVC page

thought the following was working but it turns out not to. I want to redirect the following pages for example. The original site was php then moved to aspx and now mvc. http://www.example.com/page/one.aspx http://www.example.com/page/one.php to http://www.example.com/page The IIS Rewrite rile that I...
MiscellaneousUser
1

votes
1

answer
111

Views

Archive navigation on Wordpress - Solution with .htaccess redirection

I have a problem with the navigation of my category archive (Wordpress). My website structure is example.com/blabla-news/post-name/. When I go into my category archive and want to click on page 2, it's showing me a 404 Error page i.e example.com/blabla-news/page/2 is a 404 Error page. I've found th...
Harold Martinez
1

votes
0

answer
79

Views

Mod_rewrite (.htaccess) causing 500 server error when removing extensions (.html) from URL

I was looking for a solution on many topics (E.g. 1, 2, 3, 4, 5, 6, 7,8). Unfortunately, I did not find a good solution. Overall, I want to achieve the following effect: no www. at the beginning of the URL, no .html or / at end of the URL, URL containing the full path to the file (but without showin...
Maciej Rzepinski
1

votes
1

answer
44

Views

How to setup URL paths conveniently, making them different from absolute ones?

This is my first question on Stack Overflow so far. I provide so much information, because I have a feeling that I'd gone some wrong way from the beginning, so there may be a much better solution/approach using PHP only. Info I've got a website located at my local XAMPP server and it is accessed us...
rade363
1

votes
1

answer
178

Views

Force HTTPS using .htaccess doesn't always work

with this rules RewriteEngine On RewriteBase / # For API RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR] RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d RewriteRule ^ - [L] RewriteRule (^api\/) api.php [QSA,L] RewriteRule ^ /index.html RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]...
Webman
1

votes
0

answer
15

Views

Rewrite rules for asp site with multiple string values

I am new to rewrite tools and hence posting question here. We are using ASP site with IIS 7 Url rewrite 2.0. We are getting an issue where rules are not working for a specific type of pages. We have two link one is from the oringal web site what ever it generating and other one which we have menti...
John
1

votes
0

answer
45

Views

IIS rewrite rule translation does not seem to work

I am trying to install the following plugin on my wordpress site hosted on my IIS 10: https://wordpress.org/plugins/media-vault/ The plugin requires some URL rewrite rules to be in place on the server, and as I am using IIS, the plugin can't set up these rules via .htaccess. I am now trying to conve...
Richard B
1

votes
1

answer
27

Views

Using custom error page with .htaccess

I want to remove .php file extentions and add custom error page through .htaccess file. Following is the complete code of my .htaccess file: RewriteEngine On #Remove .php file extension RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*[^/])/?$ $1.php [L] #U...
user966582
1

votes
1

answer
52

Views

.htaccess SEO URL Rewrite

I want: website.com/category.php?name=discussion to turn into: website.com/forums/discussion This is my code but it doesn't appear to work. mod_rewrite is enabled and htaccess files are allowed in the Apache configuration. Can anyone help? RewriteEngine On RewriteRule ^forums/([^/]*)$ /category.php...
hmzfier
1

votes
1

answer
19

Views

check if requested file is inside a certain folder and if yes redirect to it

Is it possible to check if a requested file (let's say: www.mysite.com/info.pdf) is inside a certain folder (let's say: www.mysite.com/downloads/, thus the real path would be www.mysite.com/downloads/info.pdf) and if yes, redirect to it in order to get downloaded?
dee
1

votes
0

answer
13

Views

Why woocommerce does not allows to add attachments with reviews?

I am working on a woocommerce based website and it does not accept attachments with reviews (though reviews without attachment works fine). It throws the following error, Oops! That page can’t be found. It looks like nothing was found at this location. Maybe try one of the links below or a search...
newbie
1

votes
1

answer
23

Views

What is the proper way to do custom rewriting (with pretty url's) in Wordpress?

I have been wrapping my (coding novice) head around this for so long time now, without being able to make it work. What I try to achieve is the following: If a visitor visits some-page/?custom_field=something I want the url to be translated to and shown as some-page/custom_field/something. What ha...
erolha
1

votes
1

answer
32

Views

htaccess redirect multiple query strings (no matter WHAT order they appear in)

So I've got a website that has old query string urls. The issue though is there are multiple versions of these query strings indexed in Google and being crawled on the site. They are going to be redirected to a new SEF url. SO, currently I have this code: RewriteCond %{REQUEST_URI} ^/mls/property.c...
PaulHanak
1

votes
2

answer
81

Views

Want to remove specific word from URL with rewrite and redirect to correct URL

In my there is a URL which contains specific word which I want to remove from URL, but original the request should go on that specific word. For example... www.example.com/web/un
Nikunj Ranpura
1

votes
0

answer
33

Views

Apache rewrite “domain.com/folder” to “folder.domain.com” with keeping redirection from “folder.domain.com” to “domain.com/folder”

I want folder.domain.com to point at domain.com/folder and I want domain.com/folder to be rewritten in the URL of page in the browser to folder.domain.com. In both cases I want to see an URL like this folder.domain.com. Tried: Redirect 301 /subdomain http://subdomain.example.com Neither work: Rewrit...
Tomekosi
1

votes
0

answer
39

Views

Java HttpServletRequest.getRequestURL() don't deliver the calling url

I have a problem to get the calling URL, For example, I call 'www.xyz.de/abc', the urlrewite.xml change it to 'www.xyz.de/test.jsp' to call the correct JSP. In the bean, I want to get the calling URL 'www.xyz.de/abc' Here's my code: HttpServletRequest httpServletRequest = (HttpServletRequest) Faces...
user9419705
1

votes
1

answer
42

Views

How to rewrite python program: foreach of two-dimensional array

people. I have a big problem here :hehe I'm trying to rewrite code from python to php, but I'm stuck in the middle of this thing. I'm creating algorithm called 'Graphs | Depth first search' Python code is fully working, PHP not. balti = gretimumosarasas pilki = [] juodi = []...
Justas Dambrauskas
1

votes
0

answer
16

Views

.htaccess and new site with /v2/

i have one site www.site.it and the new site www.site.it/v2/ is it possibile to redirect users from www.site.it to new site www.site.it/v2/ BUT removing /v2/ from url ? I think i need a simple redirect from www.site.it to www.site.it/v2/ but .htaccess on www.site.it/v2/ must contain a rule to remove...
1

votes
0

answer
45

Views

Rewrite rule for windows server + IIS and Cakephp 3.x

I want to deploy my site to Windows hosting from linux. On Linux server everything working as expected. but few things are not working on windows server. Please let me know what changes i need to do in web.config My file system is: -src -webroot --css --about.html --index.php --contact.php Now how i...
Sandeep K.
1

votes
3

answer
29

Views

How to create pretty URL's for category page queries in WordPress?

I am trying to convert category links from queries to Pretty URL's. For Example, I have category 'ALASKA'. It's URL is https://www.mywebsite.com/category/alaska/ I am getting some queries from the url using following link: https://www.mywebsite.com/category/alaska/?subscriber=1 I want to convert thi...
Rocky Sena
1

votes
1

answer
75

Views

.htaccess redirect www to non-www for subdomain that is before the www

I need to make a request to https://subdomain.www.domain.com rewrite the URL to https://subdomain.domain.com Which part of the below rewrite do I change to achieve this? I'm guessing I have to put the subdomain in front of the www, but what do I put there, also how do I capture all subdomains - what...
TheShadowbyte
1

votes
0

answer
78

Views

Tomcat urlrewrite not working

I want to redirect from this: /myApp/article2 to this /index.jsp?path=article2 I have this web.xml: myApp UrlRewriteFilter org.tuckey.web.filters.urlrewrite.UrlRewriteFilter logLevel WARN UrlRewriteFilter /myApp/* index.jsp and this urlrewrite.xml: ^/rest/(.*)$ ^(.*\.png)$ ^(.*\.ico)$ ^(.*\.css)$ ^(...
matmuc
1

votes
0

answer
77

Views

NGINX SEO Rewrite Rules Get 504 Gateway Timeout Error

Recently I am move my website Apache to Nginx. I am trying to setup rewrite rule for SEO URL in my nginx server. i am setup following rule that redirect page but web page load multiple time so my nginx get 504 Gateway Timeout Error SO how I can fix this error. Following are rewrite rules any help...
Jignesh Patgir

View additional questions