URL rewriting module for Apache web servers

learn more… | top users | synonyms (1)

0
votes
1answer
30 views

Can i redirect only my mainpage to www

When i past this code, it redirects my whole website. But when i want to go to ticket.mysite.com it gives me the 404 because it redirects me to www.ticket.mysite.com but i don't want this with a ...
1
vote
1answer
20 views

add trailing slash after removing .html extention

My website is non www ,it has wordpress in subdirectory and some static webpages in the root and other subdirectory i want to remove .html extention from the webpages in the root and the others ...
1
vote
1answer
25 views

Apache ModRewrite strip part from request_uri in rewriteCondition

so basically I have a link in my html domain.com/app/css/build/app-23471942834.css however on the server the file actually lives in /fs/current/public/css/build/app-23471942834.css. Is there a way to ...
0
votes
0answers
10 views

mod_rewrite enabled but does not working (with letsencrypt)

I know this has been asked a dozen times, but I searched in all the similarly named threats for a solution for hours now. As I did not found one, I will ask again. I have mod_rewrite enabled, but it ...
0
votes
0answers
13 views

Apache rewrite_mod in <Directory> context to override .htaccess

So what I need is to throw 403 to specific paths on my webserver, I'm on Server version: Apache/2.4.20 (Ubuntu 14.04) The paths are localhost/folder/admin and localhost/folder/superadmin for example ...
0
votes
0answers
20 views

Ngnix Rewrite Setup Along with Reverse Proxy (have some upstreamed servers)

I need to setup one URL rewrite rule in nginx, also I am having the same nginx server have 8 to 10 unstreamed servers (reverse proxy), which is running on 8080 port. I want to setup that rewrite rule ...
0
votes
1answer
36 views

apache2 rewrite configuration not working

I have a file www.example.org.conf that I want to redirect http to https. The problem is the file doesn't exactly work right. <VirtualHost *:80> ServerName example.org ...
0
votes
1answer
20 views

Mod_rewrite: Redirect to url in query string

Apache server receives request in following format http://192.168.110.65/?http%3A%2F%2Fdev.virtualearth.net How do I have Apache generate a redirect to the query string using mod_rewrite http%3A%...
1
vote
0answers
15 views

.htaccess RewriteRule for directory based with two parameters [duplicate]

I need to redirect my webpage in the likes of /dir/script.php?a=123&b=foobar to /123/foobar I've found many answers for questions like this in this site, but none of them work for my problem....
0
votes
1answer
8 views

Apache mod_rewrite. Able to “failover” when files do not exist?

I'm trying to configure mod_rewrite to attempt to load/serve files in a specific order. I think the easiest way to describe what I'm trying to achieve is with an example. Let's say in my document ...
2
votes
0answers
14 views

RewriteRule passes request to index.php

I have these two sets of rules in .htaccess: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteRule ^ index.php [L] RewriteCond ...
0
votes
1answer
29 views

Apache htaccess redirect http/www to https/non-www [duplicate]

To redirect from - http://www.domain.com - http://domain.com - https://www.domain.com to https://domain.com im using the following (apache)htaccess: <IfModule mod_rewrite.c> ...
1
vote
1answer
25 views

How to send all HTTP error codes dynamically to one PHP file when access to all other files is denied?

I'm having the following situation, I'm developing an API. I rewrite all traffic to one PHP script named: route.php, using mod_rewrite like: 1: RewriteEngine On 2: RewriteCond %{REQUEST_FILENAME} -f [...
0
votes
0answers
50 views

to set RequestHeader in apache httpd server is not working

I have a requirement, where I need to set the RequestHeader with a value retrieved from the querystring of the URI. Approach adopted is to write the RewriteCond and ReWriteRule where the condition ...
0
votes
0answers
11 views

OpenCart SEO isn't functioning even with SEO Button Enabled and htaccess configured

I have opencart installed with ubuntu 14.04, my apache config file is: <VirtualHost *:80> ServerAdmin webmaster@localhost ServerName example.com ServerAlias www.example....
1
vote
2answers
32 views

Rewrite problems with custom website and wordpress

I am managing a website tasteporto.com that is simple php/mysql with a blog part in wordpress. On the main website I have the following apache rewrite rules RewriteEngine On RewriteBase / # no-www ...
0
votes
1answer
28 views

Is there a way of writing cleaner rewrite rules if you've a large number of redirects to implement

I recentley completed a project whereby I moved a pretty large website to a nice clean smaller website. What this meant was I had to account for a large number of pages that had been indexed by search ...
-1
votes
1answer
36 views

Redirect old domain to new domain with full path

I've very little knowledge in this area - hence the question... I'm looking to do the following: I currently have a server with a number of websites listed in sites-available and sites-enabled. There ...
1
vote
0answers
22 views

Apache 2.4 mod_rewrite rule applying redirect to non-redirect rule (only [L] flag)

So I'm having this crazy-making issue happen on apache 2.4/CentOS7 with a web app. I want to redirect all non-secure URLS on the app domain to secure versions, EXCEPT for one uri (a webhook endpoint ...
0
votes
0answers
15 views

Move 2 subdomains without breaking links to themselves

Assume www.example.com contains two sub-domains, each with a different site, such that www.example.com/sub1 and www.example.com/sub2 are not related to each other. I want to move/rename sub1, but I ...
1
vote
1answer
101 views

How to redirect two domains, with/without https, to one https site?

I'd like to do the following: using Apache, redirect all of the following URLs: http://example.com http://www.example.com http://beta.example.com https://example.com https://www.example.com https://...
1
vote
1answer
32 views

Remove double slash in gitlab address [closed]

I set up gitlab on my personal server and used this answer and this answer (along with some input from this to make it work with my apache installation. Everything works fine, when I go to gitlab....
1
vote
0answers
12 views

Apache mod_rewrite Take @2x out of image request uri

For an acute server crash problem, I'm trying to match any request for @2x retina style images, and rewrite it to the non-@2x equivalent. First I want to check this is such a request: # NOTES: ...
0
votes
3answers
253 views

Check if file exists in subdirectory and otherwise redirect everything to main controller

What I'd like to do with mod_rewrite in a .htaccess file under Apache is the following: If a request for any file or path, e.g. foo.txt or foo/bar, is received, check if such file exists in the ...
0
votes
0answers
10 views

htaccess on subdomain & query string

I have the following htaccess RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. RewriteCond %{HTTP_HOST} ^(.*).domain\.com RewriteRule ^(.*)$ index-merchant.php?id=%1 [NC,QSA] It can capture $_GET['...
0
votes
0answers
57 views

Tomcat/apache2 application - virtual host issue. Welcome.action URL not found. Possible mod_rewrite issue

Im having some issues setting up a tomcat application to work with apache2. My KonaKart tomcat application is running on port 8783. And I'm trying to access it publicly on port 443. I created the ...
0
votes
2answers
53 views

Apache rewrite all URLs to lowercase if contains at least one uppercase

I have been trying to get Apache to rewrite all URL's that contain an uppercase character anywhere in it to be lowercase. All the solutions I have found do not work in my case for some reason. I am ...
2
votes
2answers
59 views

How to keep one page of a site secure using mod_rewrite

I'd like redirect access to a url from http to https for only a couple of pages on my website. I know how to do it for a whole site using the rewrite in apache virtual hosts: RewriteEngine On ...
0
votes
0answers
6 views

How to redirect all specific character strings? [duplicate]

I want to redirect all character strings to the index page using the RewriteCond Directive. A few examples to illustrate my intention www.example.com/character-string/ should redirect to www....
0
votes
1answer
56 views

RewriteRule changes URL only when it doesn't end with slash?

This simple rule in .htaccess handles languages at my website: RewriteRule "^(de|it|es|fr|en-us)(?:|/(.*))$" "$2?lang=$1" [NC,QSA] It works fine unless I miss slash at the end of URL. Than it ...
0
votes
2answers
49 views

How to disable the automatic redirection in WordPress-htaccess-file

WordPress has a function in its htaccess-file which performs an automatic redirection if the filenames match with an existing source. For example if you type in http://rechnen-in-der-wolke.net/...
0
votes
1answer
31 views

apache2 rewrite rule: delete any path from URL

I'm going crazy with a Rewrite Rule on Apache. Basically what I want to achieve is to rewrite any url like: http[s]://www.example.com/something to https://www.example.com I have a VHost on ...
1
vote
0answers
7 views

Limit access for subdir url

I would like to limit access for this url, http://example.com/dir/login however it doesn't work. The .htaccess lives inside the subdir. The conditions and rule itself works without the REMOTE_ADDR ...
0
votes
0answers
31 views

Rewrite URI so all occurrences that match strings is rewrited

I'm new to regex and I'm trying to write a rewrite query, but without results. So I hope some one can help me to solve this. So my rewrite rule looks following: RewriteCond %{QUERY_STRING} ^(.*)...
0
votes
0answers
44 views

Running Rails apps on subdomain with Apache and mod_rewrite WITHOUT VirtualHost

I am host a number of domains on Apache (Ubuntu). I am not using VirtualHost for all the domains, I am using mod_rewrite (and a custom RewriteMap to boot) to map domains and subdomains to a variety ...
0
votes
1answer
94 views

Apache rewrite rule to redirect a URL with parameters to a URL without parameters [duplicate]

I want to go from: www.website.com/directory/results?category=10&dir=asc to www.website.com/staticfile.html I tried the following and it doesn't seem to catch: RewriteRule "^directory\/...
0
votes
1answer
21 views

Rewrite for Proxying

I have 2 servers. example.com and proxy.example.com I would like proxying /server/(.)/banner/(.) to http://proxy.example.com/banners/banner_$2_$1.png I have prepared in example.com apache2 vhost ...
0
votes
1answer
67 views

Redirect all the traffic from multiple domains to single domain using htaccess

I have hosted multiple websites on my server all sharing the same code base having one htaccess. I need something like this. if (domainname != example.com) redirect to example.com if there ...
1
vote
1answer
15 views

how to use mod_rewrite in apache for a rest application

I'm not very experienced with apache but I have managed to run with the following set up for months on my test box: me@mydev:/etc/apache2/sites-enabled$ vim 000-default.conf <VirtualHost *:80> ...
0
votes
1answer
28 views

What does this RewriteRule do?

I'm trying to migrate rewrite rules from apache to nginx. Can anybody explain what RewriteRule ^api/.$ - [L] does?
-1
votes
1answer
30 views

Point subdomain to wordpress path

I have a single Wordpress instance hosted at 1.2.3.4 with the following DNS settings: A foo.com 1.2.3.4 A category.foo.com 1.2.3.4 The site is accessible from both hostnames, however, I would like ...
0
votes
1answer
20 views

.htaccess configuration to mask site?

I own a domain on godaddy (rainychat.com) and i have an app on Openshift (rainychat-jgal.rhcloud.com) Currently i have a forwarding rule on godaddy so when a user goes to rainychat.com it is ...
0
votes
1answer
27 views

mod_rewrite redirect and hide extension

I want to hide the .php extension from all files and my regex is not working properly, it is redirecting the following /path/to/script.php?param1=test.php -> /path/to/script?param1=test It is ...
1
vote
1answer
23 views

Having issues with my websites htaccess

I recently uploaded a PHP theme on my server. It's working fine on any other sections except my home page. For example, when accessing www.mywebsite.com/anything the theme is working but when on ...
0
votes
3answers
35 views

Redirect to client subfolder on apache

I'm hosting a few small client pages within my web application. Basically, they all are instances of the web application I wrote, for different clients. I'm deploying with capistrano, and so each time ...
0
votes
0answers
10 views

apache proxypass depending on querystring

I have two apps listening on ports :8085 and :8888 respectively. I am trying to serve either of the two apps depending on the presence of a querystring. My httpd-vhost looks like RewriteEngine On ...
2
votes
3answers
40 views

How do I set up a toggle for an Apache RewriteRule?

I have the following Apache config, which displays a 503 Service Unavailable error to all visitors except for my IP address: ErrorDocument 503 /503.html RewriteEngine On RewriteCond %{REMOTE_ADDR} !^...
0
votes
0answers
46 views

Apache Rewrite and ProxyPass

I got a little problem with my apache configuration at the moment Got a Vhost like this: <VirtualHost *:80> ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9001/www/$1 ...
0
votes
0answers
69 views

rewrite works in htaccess but not in apache2.conf

I am trying to move rewrite rules from .htaccess to apache2.conf (at Kubuntu to use The Bug Genie software). Rewrite rules in .htaccess works fine, but after moving (and adjusting) it to apache2.conf ...
0
votes
0answers
33 views

Issue with mod_rewrite L flag

I'm having problems with the L flag - it's not working as I think it should. Please take a look at the following code: <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^...