URL rewriting module for Apache web servers

learn more… | top users | synonyms (1)

2
votes
1answer
567 views

Apache keeps adding 8080 port by itself while I'm telling it to use 80 only

Here's my httpd.conf. Inside it, I have the following in place #Listen 12.34.56.78:80 #Listen 127.0.0.1:8887 Listen 127.0.0.1:80 #Listen 127.0.0.1:8080 Listen 192.168.1.4:80 and I have a .htaccess ...
0
votes
1answer
11 views

htaccess: get request domain for mobile redirect

We have a mobile site that is served using multiple domains. We want to redirect users who are using desktop user agents to our desktop sites while preserving the original domain the user used to ...
1
vote
1answer
18 views

Unable to combine RewriteRule and Header set [duplicate]

Trying to implement the following: RewriteRule \.ttf$ - [E=cors:1] Header set Access-Control-Allow-Origin "*.example.com" env=cors:1 Header set Access-Control-Allow-Origin "*.sadface.com" env=!cors:1 ...
0
votes
2answers
2k views

apache - query string rewrite rule appends condition to URL

In trying to rewrite site-search.html?searchword=search%20term as advanced-search#q=search%20term I always end up with advanced-search#q=%3Fsearchword%3search%20term The %3Fsearchword%3 ...
0
votes
1answer
16 views

How do I transparently redirect only the root directory on a DreamHost.com shared server? [duplicate]

The following DreamHost wiki explains how to transparently redirect your root directory to a subdirectory.. http://wiki.dreamhost.com/Transparently_redirect_your_root_directory_to_a_subdirectory The ...
-1
votes
1answer
35 views

Redirect for https and www

I currently have my rewrite rules in the post_virtualhost_2.conf file this in inserted into the httpd.conf file at the absolute end. I have two blocks that don't seem to be working <IfModule ...
1
vote
0answers
26 views

Special nginx hotlink protection conversion from Apache .htaccess rule

I have the following anti-leeching rewrite rule in Apache, which i'd like to have in nginx. I see cookie or referrer rule examples. But none combining both, so I am not sure how to go about this. ...
-1
votes
0answers
15 views

Apache Virtual Host Reverse Proxy rewriterule not rewriting everything [duplicate]

The server is being used as a reverse proxy, urls are points at the servers, the server intercepts the URLs and reverse proxies the pages from the IIS servers. The below rewrites some URLs but not ...
0
votes
1answer
39 views

Naked domain not working on VirtualHost for EC2

I am using AWS EC2 and I am redirecting example.com domain to a directory in EC2 with the following virtual host: NameVirtualHost *:80 <VirtualHost *:80> ServerName www.example.com ServerAlias ...
0
votes
1answer
23 views

How do you prevent mod_rewrite from decoding a string in the path? [duplicate]

I'm trying to create a restful API using mod_rewrite. I have the rule: RewriteRule v2/(.*)$ v1/index.php?request=$1 [QSA,NC,L] However the path could contain base64 encoded strings (i.e. can ...
2
votes
1answer
2k views

Apache mod_rewrite - remove extension/add trailing slash/preserve directory structure

I am currently using the following .htaccess file to remove the .php extension from my files and add a trailing slash to all URLs: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond ...
0
votes
1answer
909 views

Apache ProxyPass/RewriteRule with p flag: Return no content when response has multi-part content type i.e.images

This is a continuation of a previous question which has been implemented with a little change. Following is the structure I am going to talk about. My goal is to create the Tunnel/Proxy. ...
-1
votes
0answers
10 views

.htaccess to redirect phone users to different photos folder not working?

I realize there are numerous similar questions. I have checked them and can't figure out where the problem is. I have a large directory of small-for-phones photos ("mobile") using the same ...
0
votes
0answers
13 views

Use custom environment properties from Elastic Beanstalk for htaccess

Is there a way to use the custom environment property of elastic beanstalk in htaccess? I only want to rewrite http to https when not running locally so I thought I could do this by using the ...
0
votes
1answer
30 views

mod_rewrite not acting as expected — missing path info

I've just installed a fresh apache (Apache/2.4.7 - Ubuntu) and created and enabled a site with a Document Root of /var/www/html. With mod_rewrite enabled, I proceeded to create a simple .htaccess file ...
0
votes
0answers
111 views

Converting .htaccess to lighttpd rewrite rules for Chevereto

I am trying to translate Apache2 htaccess rules to lighttpd rewrite rules. My lighttpd version is 1.4.33. Chevereto uses the G\ php microframework. Apache2 htaccess rule i am trying to convert: ...
4
votes
1answer
2k views

Apache sends plain-text response when accessing SSL-enabled site without HTTPS

I've never encountered something such as this before. I was attempting to simply redirect the page to the HTTPS version if it determined that HTTPS was off, but instead it's displaying an HTML page ...
0
votes
1answer
931 views

Apache/2.4.6 update causes 404s

I'm running a ec2 ubuntu instance, I decided to update my PHP today to 5.5.7, unfortunately it triggered apache to update as well, which has caused me many errors, the biggest one is my rewrite rules ...
2
votes
1answer
862 views

Apache redirecting https://host:port/folder to http://host:port/folder/

I have a apache server using two SSL domains (no SNI support) in different ports, kinda like this: https://host1.tld:443 (default) https://host2.tld:444 (non-standard) I have a Rewrite rule to ...
-1
votes
1answer
22 views

symlink to PHP file not handled as PHP

I have PHP5 installed on an Ubuntu 14.04 server and it works fine. I create a file called foo.php anywhere in the document tree and it gets passed to the PHP interpreter just as you'd expect. ...
0
votes
1answer
39 views

mod_rewrite: strange infinit loop [duplicate]

I have a folder structure, like this: forum .htaccess [some more files] forum_english .htaccess [some more files] forum/.htaccess looks like this: RewriteEngine on RewriteCond %{HTTP_HOST} ...
2
votes
2answers
2k views

Apache Redirect To Another Server with subdomain

I am currently running CentOS which hosts my web and gitlab server and a windows machine that is hosting a subsonic server. Currently, my ip points to the CentOS but does not redirect correctly. I am ...
1
vote
1answer
27 views

How to point at all subdomains of a secondary domain to the main domain

I have a secondary domain name which I need its subdomains to point to my main domain. For example,If my main domain is example.com, then I have used example.org to point to the former. What I desire ...
2
votes
2answers
2k views

apache2 - how to exclude alias from rewrite rules?

I have setup mod_rewrite and mod_alias on Apache2 on Debian (in a test server). I have the following rewrite code in /etc/apache2/sites-available/default: <Directory /> Options ...
0
votes
0answers
26 views

Apache HTTP to HTTPS Redirection on none HOST NAME

I'm not able to get a corect redirection from http to https on every url on my Apache on Centos. I got this in the httpd.conf: LoadModule rewrite_module modules/mod_rewrite.so NameVirtualHost *:80 ...
1
vote
1answer
28 views

Apache2.4 mod_rewrite won't redirect me to subdir based on visiting domain

I have an Apache2.4 server with public dir in /var/www/html. In that dir I have a Wordpress site with this .htaccess: RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f ...
1
vote
1answer
31 views

mod_rewrite date subfolder not working

I am having a strange issue that I am perplexed on. I will prelude with that regex is not my strong suit. I need feedback from the community to get this going. If I have the following URL: ...
1
vote
1answer
1k views

How to get apache to look for files in different subfolders folders?

I am definitely new to mod-rewrite stuff. Note:- here the URL is common, and all the folders and subfolders on same host. The url a user uses to access their page is ...
1
vote
1answer
22 views

Denying a User-Agent in apache that uses mod_proxy

I want to prevent web crawlers from using an apache site that is configured to forward all requests to a ProxyPass. I have tried the BrowserMatchNoCase directive to set an environment variable ...
0
votes
2answers
30 views

How to rewrite URI from root if file doesn't exists in folder?

I have a static folder which is not in my document root. I would like to redirect all the files that are not present in document root, but are present in the static folder. (So if the same file is in ...
1
vote
3answers
1k views

Empty rewrite.log on Windows, RewriteLogLevel is in httpd.conf

I am using mod_rewrite on Apache 2.2, Windows 7, and it is working ... except I don't see any logging information. I added these lines to the end of my httpd.conf: RewriteLog ...
0
votes
0answers
26 views

RewriteCond and LocationMatch

I am running a Magento instance and am trying to tune the browser cache headers appropriately. All requests should have cache headers set, except for the checkout pages (any url that like ...
0
votes
1answer
34 views

Reverse proxy Apache rewrite rule doesn't work

I've an apache reverse proxy and i try to make a rules for redirects few urls of example2 to example1 but my rewrite rules doesn't work. I've try this in the vhost of example2 : ProxyPass / ...
0
votes
1answer
19 views

Test file existence outside DOCUMENT_ROOT

I have this .htaccess file inside DOCUMENT_ROOT where it checks for the existence of a file, maintenance.enable and serves maintenance.html if it is present: <IfModule mod_rewrite.c> ...
0
votes
2answers
898 views

Server, Database or Code Issue? Magento backend rewrites itself with a index.php which doesnt work

I will be honest and admit my cross posting in magento.stackexchange.com but the reason is that I believe it is a server fault, and now I am looking for proof to present to my dreaded hosting ...
0
votes
2answers
390 views

HowTo rewrite subdomain to apache userdir

As described in this blog I want to rewrite internally http://xy.user.phpfarm.lan -> http://user.phpfarm.lan/~xy/ Module userdir is enabled. With the following Apache2 vhost config file, it ...
3
votes
3answers
1k views

Configuring htaccess/mod_rewrite to serve static files with question mark in the URL

I've just taken on hosting of an ancient site that was converted from asp to static html, consisting of about 6,000 files. However, my server doesn't like the filenames, giving a 404 error. The URLs ...
-1
votes
1answer
60 views

Apache configuration redirect using only redirect, not rewrite

PS: this is the 2nd part of the question originally posted here. I'd like to disable the HSTS header completely for specific virtual hosts. I have (per recommendation) a redirect in the 443 container ...
0
votes
3answers
1k views

How to insert an “index.php” into every url using .htaccess?

Example: My Site gets called like that: www.example.com/controller/method/parameter1/parameter2 Now, .htaccess needs to rewrite this URL into: ...
0
votes
0answers
10 views

Apache mod_rewrite with proxy to HTTPS from HTTPS host

I am trying to use the mod_proxy to rewrite internal one URL to another in this way: RewriteCond %{HTTP_HOST} ^www\.domain\.de$ RewriteCond %{SERVER_PORT} ^443 RewriteRule ^blog/(.*)$ ...
0
votes
0answers
7 views

htaccess rewrite rule for subdomain results to redirect loop [duplicate]

Below is my htaccess config: RewriteEngine On # if the domain starts with "apply." # i.e. apply.example.com # redirect to application URI RewriteCond %{HTTP_HOST} ^apply\. [NC] RewriteRule ...
0
votes
1answer
29 views

Mediawiki migrate existing wiki page to shortURL without afecting SEO (maintain old links)

Following the steps at: http://www.mediawiki.org/wiki/Manual:Short_URL http://www.mediawiki.org/wiki/Manual:Short_URL/Apache I have already migrate my wiki page from URLs: ...
1
vote
1answer
1k views

Accessing HTTP response in Apache Rewrite/SetEnvIf (content type, expires headers)?

Is it possible to access response object data in Apache SetEnvIf RewriteCond ... so that one could manipulate headers based on content type and caching output? From the documentation it seems ...
5
votes
2answers
4k views

apache url / filename with special characters

I have this url: http://domain.com/wp-content/uploads/2012/10/Hvilke-vilkår-følger-med-når-du-bestiller-nyt-bredbånd.png If I ftp/ssh or just browse to that folder (apache index feature), I see ...
0
votes
1answer
46 views

Mod_rewrite Underscores to Dashes (or Hyphens) in Opencart

I'm transferring an e-commerce site to a new shopping basket. For some reason the old site used dashes for categories but underscores for products. So the full url of a product looks like this: ...
0
votes
1answer
8 views

apache allowoverride points to wrong location

I installed a Slim framework to create a API and located this under /opt/modul/www/api index.php slim/ so the index.php is my main API file. And I want to access this in the browser under ...
3
votes
3answers
255 views

The 301 'www' nightmare. How do I change back?

About six months ago, I decided it would be best to put my website on the naked domain, let's just say 'example.com'. I did what all the instructions websites have told me with adding a 301 redirect ...
1
vote
2answers
50 views

Why is everything after RewriteEngine On ignored?

So I'm trying to get mod_rewrite working on my new site. I've used mod_rewrite successfully a few years ago, but this time not a single command after 'RewriteEngine On' works. I'm getting exactly the ...
0
votes
0answers
24 views

Apache rewrite rule not transforming URL as desired

I have an Apache site running that should only be accessed via HTTPS. What we wish to ensure is that if the site is called by it's DNS shortname (example, https://webserver01 rather than ...
0
votes
1answer
174 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 ...