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.

2112 questions
0
votes
1 answer

How do I use rewrite in Nginx to convert an Apache redirect rule?

I need some help to convert .htaccess apache rewrite to Nginx. My WordPress website has this URL structure: https://domain.com/our-office/laos/ And I need to change to: https://domain.com/laos/ I did that easily with Apache and .htaccess…
Daniel
  • 193
  • 1
  • 6
0
votes
2 answers

Apache Redirect: to prepend 'www' and Clean URLs

I am administrating an Apache/2.2.15 webserver with several virtual hosts. For one of these hosts I want to always prepend a missing www.. Besides that, I want to add several short-cut URLs. Here is what I have done so far: RewriteEngine On Redirect…
0
votes
1 answer

rewrite rule is ignored

I have some problems with rewrite rule. I have 2 scripts, article.php?url= and product.php?ulrprodus= and I want to setup for them rewrite rules like below: My Rewrite rules: RewriteEngine On Options +FollowSymLinks RewriteRule…
0
votes
2 answers

Apache Alias to link to another DocumentRoot

I have a WordPress installed in /var/www/wordpress/ and my own code in /var/www/project/ Now comes the following problem: When I try to access example.com/client/ or example.com/admin/ it should link to /var/www/project/ and execute the .htaccess +…
Aley
  • 209
  • 2
  • 4
  • 16
0
votes
1 answer

Apache redirect and pass query string on to remote host

I'm hoping this is super easy for someone. I need to create a redirect in apache where... http://something.com/a/1234567890 -> http://other.com/a/1234567890 http://something.com/a/8971347873 -> http://other.com/a/8971347873 But I have other URLs on…
Charlie
  • 103
  • 3
0
votes
1 answer

Nginx does not redirect with rewrite

I have a nginx + php on windows server configured. I work on an MVC framework with url rewriting, the problem is that my server does not resolve the addresses. Quite simply, this is my code: server { listen 127.0.0.1:80; server_name…
Victor
  • 1
  • 1
0
votes
1 answer

How to: Zend .htaccess Lighttpd conversion

We are using Zend Framework, we switched from apache to lighttpd, main htaccess file for zend is this: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule !\.(js|ico|gif|jpg|png|css)$…
Devrim
  • 1,187
  • 4
  • 16
  • 29
0
votes
2 answers

With nginx serve a custom 404 page with header 404, without changing the browseraddress

How do I force nginx to serve a custom 404 page while responding with a 404 header, without changing the address of the browser so the user can easily retype? set $allowed 0; #(updated after comments) error_page 404 /404page.html; #(updated after…
C.A. Vuyk
  • 632
  • 10
  • 18
0
votes
1 answer

GIF loses mime type with Apache rewrite

Got problem with a gif that loses it's animation with the rewrites I'm doing. RewriteRule ^journal/(.+)\.(jpeg|jpg|png|mp4|webm|ogv)$ app/uploads/journal/$1 [QSA,L] RewriteRule ^journal/(.+)\.(gif)$ app/uploads/journal/$1 [QSA,L,T=image/gif] For…
INT
  • 121
  • 4
0
votes
1 answer

Redirect multiple browser requests to one site with IIS URL request

we have a web server with several websites. Of these, only one site has real content, the other sites are used to redirect requests to the content site. This is done by the IIS http redirect. www.contentsite.com -> web site with…
0
votes
1 answer

Route request to Tomcat only if file doesn't exist on disk

I have Apache in front of my Tomcat installation as a reverse proxy. Most URLs are routed to Tomcat by a JkMount directive in Apache. For one URL pattern I'd like Apache to route requests to the Tomcat worker only if a static asset isn't found on…
spiffytech
  • 1,063
  • 2
  • 11
  • 17
0
votes
1 answer

Nginx and complex URI rewrites

I'm having problem with getting logic behind Nginx rewrites. Are they supposed to be in server or location directive? I need to rewrite one long and scary URL to another. Is there anyone who can help or at least show me resources to get this done?…
Chris
  • 1
0
votes
1 answer

Tomcat 7 URL rewrite from other domain

On a tomcat 7 server, we've configured a https connector, the TLS certificate is valid for an URL like www.example.com . Now we want to change the A record of one of our subdomains (like foo.bar.com) to point to the tomcat server. How can I…
Mr.Radar
  • 133
  • 1
  • 6
0
votes
1 answer

Forcing https redirect is rewriting all URLs to root directory and not appending latter half of URL

I'm forcing http to https with the following in .htaccess: ## Forcing https RewriteCond %{HTTPS} !^on$ RewriteRule (.*) https://website.com/$1 [R,L] Following that, I also have a redirect that redirects users from the web root of this site to a…
sparecycle
  • 459
  • 1
  • 6
  • 19
0
votes
1 answer

Nginx Passenger Node Application URI Rewrite

I have a node application that accepts all routes starting at /. The Nginx / Passenger configuration for it is: server { listen 8889; server_name localhost; location / { root /var/www/portal/public; passenger_enabled…
xmon
  • 1