URL rewriting module for Apache web servers

learn more… | top users | synonyms (1)

0
votes
0answers
116 views

Apache Alias on multiple vhosts + redirect rules

I'm facing a tricky problem and I have problems to solve it through Apache config. I have two vHosts on my machine: A) /var/www/front/web app.domain.ext B) /var/www/api/web api.domain.ext This ...
1
vote
1answer
223 views

mod_rewrite exact hostname match with multiple conditions

I have a set of requirements for mod_rewrite that is breaking my head. Any hints / pointers would be appreciated: domains: www.domain-europe.com www.domain.com requests for www.domain-europe.com ...
0
votes
0answers
55 views

Can you do a masked URL rewrite to a different protocol (in Apache)

Apache 2.2.15; I want to do: RewriteCond %{HTTP_HOST} site1.com RewriteRule (.*) https://site2.com [R=301,P,L] But that does not work. I put the P in there thinking it might allow the mod_proxy ...
0
votes
0answers
84 views

Proxy to SSL site (on another server) from a non SSL site

I have a *:80 virtual host in Apache 2.2.15 which is just a bunch of URL rewrites like: ServerAlias foo.bar biz.baz tit.tat RewriteRule / http://somesite.com (R=301,L) ServerAlias ...
1
vote
1answer
4k views

How to pass a request from one apache server to another

I have two Apache Servers with mod_proxy enabled. I want to know how to "pass the request" from "Apache Server A" to "Apache Server B" using the same port (80). In "server A" with internal ip: ...
1
vote
0answers
430 views

nginx rewrite for php restful api apache htaccess

I have an apache htaccess file used with Restful API tutorial <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-s RewriteRule ...
0
votes
1answer
1k views

How to configure a base URL in Apache? [duplicate]

I have the following problem: The Apache DocumentRoot is /var/www/. The URL of the file one should get when browsing http://www.example.com/ is http://www.example.com/_www/en/home.html So I ...
0
votes
1answer
20 views

Does RewriteEngine On enable for all subsequent vhosts

If I have in my conf.d Apache directory 001_vhost.conf 002_vhost.conf ... etc, does Putting RewriteEngine On in 004_vhost.conf enable the Rewrite Engine for 005 006 007 008 etc vhosts, but not those ...
0
votes
1answer
61 views

can htaccess file define different RewriteBase for production and dev servers

I have htaccess files that use different RewriteBase on production and dev (windows) pc. Currently I change the RewriteBase manually when deploying. Can this be done automatically with some ...
0
votes
1answer
22 views

Setting up additional breadcrumb re-direct using mod_rewrite

Currently I have mod_rewrite configured as follows: <VirtualHost *:80> ServerName address.website.org ServerAdmin webmaster@website.org DocumentRoot /var/www Redirect permanent / ...
0
votes
1answer
217 views

apache2 redirecting https to http

[tl;dr] Why is apache redirecting https that has gone through rewrite engine to http I have a site that is redirecting some pages (only ones that have been through rewrites) from https to http. ...
0
votes
0answers
43 views

Remove Port Access Using mod_rewrite or Something Else

Server Info: Apache VPS, WHM/cPanel, CentOS I am using a CDN/reverse proxy (Cloudflare) to obscure the true IP of my server. So I intend to access WHM/cPanel using the direct IP like this: ...
2
votes
0answers
478 views

Apache 2.4 + mod_rewrite + FastCGI (php-cgi.exe) on Windows

I am trying to port my Mac config on Windows for some of my clients. Since Windows is not Mac OS, I have to use php-cgi.exe instead of PHP-FPM. I have tested each component individually and ...
0
votes
1answer
369 views

Apache rewrite using THE_REQUEST for rewriting GET requests only

Background: In order to reduce repo size of git repos containing wordpress installs, we are removing static assets from the repo. The bulk of the work is done, but I have a snag. I've relocated the ...
-1
votes
1answer
196 views

Mod_Rewrite Laravel Folder

Ok I'm pulling my hair out, can't get the mod_rewrite rules to work. This is my apache config <VirtualHost x.x.x.x:80> DocumentRoot "/web/domain1/" ServerName www.example.com ServerAlias ...
0
votes
3answers
247 views

Apache rewrite - Redirects to example.com// instead of example.com [duplicate]

When trying to redirect an URL in apache from: www.example.com to example.com it redirects to example.com// This is a one page webserver, Fixed IP goes directly to the page. Editing ...
2
votes
5answers
372 views

Rewrite Rule: appending a path to URL

Update Thanks for all the replies so far. I'd like to make clear that the number after user (e.g. user1) in my example is not significant. The user can be any alphanumeric name. I want to make ...
0
votes
1answer
95 views

redirect string to different url in nginx

I want to redirect a string to different URL in nginx. This what my vhost looks like and is working fine. server { listen 80; server_name secure.example.com; root /opt/tomcat/webapps/test/; ...
0
votes
1answer
48 views

mod_alias.c rule to redirect all subdirectories

A mod_alias newbie here. I found the rewrite rule below somewhere and have been using it to block bots and hackers that hit my site, looking for directories like HNAP1, wp, blog, etc. And it works ...
0
votes
1answer
162 views

apache - query string rewrite rule adds percentage symbol

I've set up a rule to rewrite a query string. Although the redirection is correctly performed, a % character is appended to the rewritten query portion of the URL, like so: ...
0
votes
1answer
84 views

Configuring subdirectory with apache2 and HTTPS

I have a domain my.domain.com that points to a Zend Framework 2 application at /path/to/project/public which has a .htaccess and index.php file which handles all requests. At ...
0
votes
1answer
99 views

How can I rewrite from /page to /xx/page, using htaccess & apache only?

Hi I have found many resources on mod-rewrite and Apache but I haven't been successful of making a working example. The example below works for ✓ WORKS example.com/en/page1.php ☞ ...
0
votes
2answers
1k views

How to rewrite from /page to /xx/page, using htaccess & apache only?

Visualise a three step jump sporting event, with the first two steps perfect in place and the third step launching into air, never coming back and eventually a crash! That is what this question boils ...
0
votes
1answer
232 views

Pretty permalinks not working Apache, Wordpress, Mod rewrite

I'm trying to change the permalinks in Wordpress, so the URL uses the post-names instead. I've tried to modify the httpd.conf directly as below but Apache doesn't seem to be parsing the URL. I keep ...
0
votes
1answer
43 views

Redirect Alternative Domain Names for a Web Site While Maintaining Request Integrity

We bought some domain names that are similar to the primary domain name for our Web Site. All of these alternative domain names are associated with a single VirtualHost of which I can edit the single ...
0
votes
0answers
29 views

Handling spaces in SCRIPT_FILENAME with mod_rewrite

I'm having trouble using a reverse proxy when my URL has a space in the script name. For example: http://test.com/exam/good%20job.html?success=1 Gets rewritten and sent to: ...
1
vote
1answer
37 views

ModRewrite combine sites to one

Hi I am having some issues configuring rewrites which have fairly complex requirements browsing (www.)A.com should => www.B.com browsing (www.)A.com/{anything}/blah/foo/yes should => ...
1
vote
2answers
64 views

mod_rewrite mysteriously appends subfolder to rewritten url

EDIT: [Solved] Finally found the solution in the documentation; posted an answer. In short: the DPI flag. EDIT: at the bottom, added an easy way to reproduce the problem online. I've spent a few ...
0
votes
0answers
12 views

How to get log of the addres that mod_rewrite is redirecting to?

I have defined a rewrite rule that is creating an 404. But I can't find any additional information about where the Apache is really looking for the file so it can't find it and also I don't see ...
1
vote
2answers
146 views

Apache mod_rewrite: domain -> www.domain with wildcard SSL

I have an Apache 2.2 server and a wildcard SSL certificate for *.domain.com and have set up a mod_rewrite ruleset for both 80 and 443 that will properly redirect requests for domain.com to ...
3
votes
2answers
421 views

Mass virtual hosting with Apache 2.4

I would like to use the value set by VirtualDocumentRoot in a RewriteRule. The Apache documentation says: The other thing to determine is the document root (configured with DocumentRoot and ...
0
votes
0answers
94 views

Rewrite/configure WebSVN location with MultiViews

I have configured mod_dav_svn 1.8.9 on FreeBSD along with WebSVN 2.3.3 this way: <Location /repos/svn> DAV svn SVNParentPath /usr/local/svn/repos SVNListParentPath On ...
0
votes
0answers
170 views

DirectoryIndex not working properly for rewritten URL

I have domain.com and sub.domain.com pointing to the same server and I'm using mod_rewrite to rewrite URLs for sub.domain.com to the sub subdirectory. I have the following .htaccess file in the ...
0
votes
2answers
47 views

Mod Rewrite based on HTTP_HOST don't change browser address

I am not exactly clear on why this isn't working properly. I have sub.domain.com with its contents in /sub_folder, and sub.domain.com is listed in the ServerAlias directive for domain.com. The DNS ...
0
votes
1answer
102 views

htaccess rule for url not ending with certain words

I need to rewrite few urls if those url not ending with certain words. For example, i need to rewrite following url /category1/subcategory1/aproduct-url-title to ...
0
votes
1answer
96 views

rewrite rule does not rewrite url as expected

I have a problem with a CMS website, that normally generates readable urls. Sometimes it happens that navigation links are shown as www.domain.com/22, which results in an error, instead of ...
1
vote
2answers
755 views

Apache httpd mod_rewrite with Tomcat resulting in lost JSESSIONID

So I'm working on a Java web application, for which I recently implemented an authentication module that relies on the JSESSIONID cookie to identify users. I was testing on a local tomcat from eclipse ...
0
votes
1answer
83 views

Redirect domain/directory to domain2/directory

I would like domain1.com/customers to go to domain2 my home directory public html's folder / customers. Both domains are on different servers. In the folder on the second server/second domain we will ...
0
votes
1answer
29 views

mod_rewrite Unmatch of .php and Also Slash

I'm trying to write a set of rewrite rules that will send all requests for static assets to our CDN while keeping requests for PHP files local to the server. I have one rule that works for "match ...
0
votes
2answers
86 views

Subdomain-to-folder redirect (HTTPS)

I have the following in my httpd.conf at the very bottom. No other configuration is done. NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin webmaster@contoso.com ServerName ...
0
votes
0answers
170 views

Apache rewriting sub domain URL with www prefix

My website is rewriting all subdomain links with www. for example news.example.com works fine, but if I go to news.example.com/wp-admin it will rewrite the URL to www.example.com/wp-admin ...
1
vote
2answers
149 views

Lighttpd rewrite subdomains to subfolders

I have a server (itself on a subdomain) with wildcard DNS pointing to it. The server is running Lighttpd and PHP. I need requests to http://any-subdomain.server.example.com to rewrite to ...
-2
votes
1answer
113 views

How to redirect using Apache [closed]

I am working on moving an IIS server website onto an AWS Load balancer. I am trying to figure out how to Manipulate a web link in Apache. My team and I are currently using IIRF to redirect the link in ...
0
votes
1answer
48 views

Masking external domain with Apache2 [closed]

Let say, that you own domain www.example.com and have another project on another domain on server that you do not have control: www.sub.notmine.example.org. And you want an user do navigate to ...
0
votes
0answers
89 views

Changing the current URL but serving content from another (same domain) - ProxyPass?

I've been banging my head against the wall with this for months now so I hope someone on here will be able to finally advise what is needed for this. I have some URL's like this:- ...
0
votes
2answers
408 views

A RewriteRule for all VirtualHosts on Ubuntu 14.04?

After a2enmod rewrite, I wrote the file /etc/apache2/conf-available/myspecific_rewrite.conf : RewriteEngine on RewriteRule ^/test(/.*)?$ http://anothersite.tld/test$1 [R] RewriteRule ^/test2(/.*)?$ ...
0
votes
0answers
33 views

htaccess negation rule not being followed

I'm working on a wordpress blog. The .htaccess file for it includes this block: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond ...
0
votes
1answer
89 views

redirect landing without changing url

I'm working with Apache and Joomla. I would like to have some URIs that land to the same landing page, but avoiding the URL changes. So, for example: examplecom/luggage/delay/iberia ...
0
votes
0answers
27 views

ProxyPassReverse from unique path and HTTP_HOST

This is probably super simple and something I overlooked (or totally misunderstand). Trying to redirect all incoming traffic for a certain path to one of my other servers (I put the wrong environment ...
0
votes
1answer
28 views

Apache Windows MOD_REWRITE &

One of our clients is using Apache 2.2 as a reverse proxy server (Yes, stupid of them) and we're seeing some very funky behavior when trying to redirect some URLs and I'm curious if anyone has seen ...