Questions tagged [mod-rewrite]

mod_rewrite is an Apache module that allows for server-side manipulation of requested URLs.

Filter by
Sorted by
Tagged with
0 votes
1 answer
987 views

Add www to domain but not for a specific domain

I've the following code in my .htaccess file: RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] The code above is for adding www to the domain if it does not ...
Igor's user avatar
  • 135
0 votes
1 answer
516 views

Apache HTTPD mod_rewrite rule to redirect a specific path to a Tomcat Worker (AJP)

I've an Apache HTTPD server (and it's driving me nuts already). I've configured several tomcat workers. So a https://something.domain/WebApp1/ activates the web-application on the specified tomcat via ...
OddDev's user avatar
  • 111
0 votes
1 answer
44 views

Using rewrite engine to route domains to paths on one DocumentRoot

I have two domains: domain1.com domain2.com I have one Apache 2 server, with a document root /svr. I want the following to occur: domain1.com routes to the equivalent of /svr/examplepath/...
user avatar
0 votes
1 answer
140 views

Is it possible to avoid certificate warnings in Apache for alternate SSL host names?

I have an Apache server serving a single virtual host https://app.example.com. For legacy reasons the site is also known under another name https://myapp.example.com. For users connecting to the ...
Aditya K's user avatar
  • 933
0 votes
1 answer
46 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 ...
Javacadabra's user avatar
0 votes
1 answer
1k 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 apache ...
cloud81's user avatar
  • 163
0 votes
3 answers
283 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 ...
jwir3's user avatar
  • 155
0 votes
1 answer
1k views

Apache redirect - let's encrypt SSL certificate redirecting to naked domain rather than www

I recently set up a new website running off Wordpress which is working nicely. Since I wanted to have an SSL certificate for the website I thought I'd use Let's Encrypt since I've been hearing a lot ...
Cromulent's user avatar
  • 340
0 votes
1 answer
1k views

How to exclude a domain from redirection in Apache2

I have a blanket redirect setup on the server like this: <IfModule mod_rewrite.c> RewriteEngine On #redirect all port 80 traffic to 443 RewriteCond %{HTTPS} ...
RandomWhiteTrash's user avatar
0 votes
1 answer
34 views

move mod_rewrite content from .htaccess to apache2.conf

After moving this mod_rewrite code from .htaccess in the directory to apache2.conf its no longer working RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d ...
clarkk's user avatar
  • 2,085
0 votes
2 answers
2k views

mod_rewrite errors when migrating from Apache 2.4 to Apache 2.2

I have a list of rewrite rules stored in my website's .htaccess file, rewriting URL's like http://example.com/cloud/something to http://example.com/cloud/index.php?page=something. These rules worked ...
mittelmania's user avatar
0 votes
2 answers
728 views

Configuring a server-wide RewriteRule in conf-available

Lately I have been getting some referrer spam in my website's logs. In order to stop this (as it's quite annoying and also polluting my statistics), I want to block requests that are coming from ...
Nic Wortel's user avatar
0 votes
2 answers
15k views

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 ...
Aley's user avatar
  • 209
0 votes
1 answer
232 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 ...
Gaia's user avatar
  • 1,895
0 votes
1 answer
2k views

Configuring .htaccess on a site with a CodeIgniter app and traq issue tracker

I have this site running on CodeIgniter and I have installed traq for issue tracking. Under public_html I have my application and system directory as well as an assets directory, and also traq. i.e.: ...
alexg's user avatar
  • 101
0 votes
2 answers
6k views

RewriteRule Works With "Match Everything" Pattern But Not Directory Pattern

I'm trying to redirect newsletter URLs from my local server to an Amazon S3 bucket. So I want to redirect from: https://mysite.com/assets/img/newsletter/Jan12_Newsletter.html to: https://s3....
kmgdev's user avatar
  • 125
0 votes
1 answer
2k views

Using mod_rewrite rules in global server config

The Problem I'm attempting to make a mod_rewrite rule in Apache's global server configuration, and have it take effect for all Virtual Hosts. The documentation certainly indicates this is perfectly ...
Christopher Karel's user avatar
0 votes
1 answer
47 views

Why does this rewrite rule require *.*

I want to redirect requests for any images with filenames starting with a string like 'myimage_' to a subdirectory on another server. I'd like to understand why the following rule does not work for my ...
codecowboy's user avatar
  • 1,367
0 votes
1 answer
57 views

Multiple rule Apache rewrite and standard pages

In reference to: Multiple rule Apache rewrite While this works great for the multiple levels of item drill down I still have need for an admin.php page to run outside of the rule. Currently under ...
xxx's user avatar
  • 33
0 votes
1 answer
2k views

apache mod_proxy or mod_rewrite for hide a root of a webserver behind a path

I have 2 apache 2.2.21 one external and one internal, I need to map the internal apache behind a path in external apache, but I have some problems with absolute url. I tried these configurations: ...
Giovanni's user avatar
0 votes
1 answer
88 views

Redirect to new domain and preserve username

I recently switched to a new domain for a version control server I run. The server is usually accessed with a username included in the url such as https://[email protected]/some/stuff. I ...
David Brown's user avatar
0 votes
2 answers
802 views

How do I configure my httpd rewrite/proxy to direct app1.example.com:443 to localhost:8080 and app2.example.com:443 to localhost:8081?

I have two Tomcat instances, one running on port 8080 and the other running on 8081. The both have deployed a web app called app.war but they are separated not only by different ports, but different ...
dacracot's user avatar
  • 469
0 votes
2 answers
5k views

How to change NGINX server name

In the Apache web server we can change the server signature (Apache Name) using mod_rewrite. For example - http://www.howtoforge.com/changing-apache-server-name-to-whatever-you-want-with-mod_security-...
Kimi's user avatar
  • 3
0 votes
1 answer
283 views

Apache reverse proxy logic based on arbitrary header

I have apache running on a natting fw, that authenticates, reverse proxies, and provides an ssl wrapper for 2 webapps on the back end. This works with virtual hosting and proxies back based on the ...
MattPark's user avatar
  • 303
0 votes
1 answer
53 views

Inspecting apache mod_rewrite

I want to do something simple with apache mod_rewrite. And guess what, it doesn't work. Had I been in a "sane" environment, maybe I would get an error and a stack trace. Or maybe I could use a ...
sabof's user avatar
  • 553
0 votes
1 answer
413 views

mod_rewrite capturing domain and tld

I'm using mod_write to rewrite this www.variabledomain.variableext to http://my.com/variabledomain.variableext Note that variabledomain and variableext are really variable, so I can't hardcode ...
sameold's user avatar
  • 993
0 votes
2 answers
4k views

How can I rewrite a URL and pass on the original URL as a parameter?

I'm building a site that needs to include a 'check' procedure, to do several initiation tasks for a user's session. Examples include checking whether they're accepting cookies, determining if their IP ...
Bobby Jack's user avatar
0 votes
1 answer
455 views

mod_negotiation and mod_rewrite

I'm trying to configure a URL scheme that a) allows the ".html" extension to be omitted and b) sends 403 (Forbidden) errors under certain conditions. However, with the following setup: Options +...
Bobby Jack's user avatar
0 votes
1 answer
124 views

htaccess issue - 500 internal error

I have installed an app which has the following rewrite rule. It runs fine in a VPS setup - but in every shared hosting it is showing 500 error. The log is showing "bad delimiter" - I am completely ...
Hasin Hayder's user avatar
0 votes
1 answer
422 views

Unable to enable Apache re-writing

Apache newb here. Ultimate goal is use Apache as a reverse proxy (got that working) and append a particular value to a query string (can't get it working) via mod-rewrite. The string in question ...
Russell Christopher's user avatar
0 votes
1 answer
3k views

how to make a url rewrite rule exception?

I have a bunch of rewrite rules to redirect visits from domainX to domainY, however now I want show an index.html page when people visit domainX, but I still want all the other rewrite rules to apply. ...
ChatGPT's user avatar
  • 346
0 votes
1 answer
498 views

Lighttpd mod_rewrite to Apache mod_rewrite

I want to turn this Lighttpd mod_rewrite to apache rewrite code. $HTTP["host"] =~ "^(i\.ylar\.se|puush\.me)$" { server.document-root = "/var/www/servers/i.ylar.se/" url.rewrite-once = ( ...
Ylar's user avatar
  • 3
0 votes
2 answers
3k views

Apache .htaccess rewrite not working

Hi all been banging my head against a wall on this one and looked at a lot of articles. My Task I'm trying to rewrite 3 sections of a wordpress site to https if they are accessed over http: /cart/ ...
squareborg's user avatar
0 votes
2 answers
54 views

Redirect url's using RewriteRule

I had a site, say example.com/drupal running on xampp I have since changed the DocumentRoot in httpd.conf to /drupal/, so that I could access my site using example.com But Google has already crawled ...
user160548's user avatar
0 votes
2 answers
8k views

How to rewrite rules for two subfolders using mod_rewrite

I would need to do something like this: ########## SITE 1 RewriteEngine on RewriteBase /mysite1 RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index....
Steve's user avatar
  • 203
0 votes
1 answer
306 views

Force both HTTPS and HTTP with .htaccess [duplicate]

I have several domains under the same server, but my https certificated only works for one of them. I need to force https for: mydomain1.com All other domains (mydomain2.com, mydomain3.com ...) must ...
Acacio's user avatar
  • 3
0 votes
1 answer
61 views

.htaccess file is not working on a site for auto-generation of files

I am trying to debug an issue with my .htaccess file. I have a directory which is /wp-content/plugins/lot-wp-app/content which contains a .htaccess like so: Options +FollowSymLinks RewriteEngine On ...
Joe Simpson's user avatar
0 votes
1 answer
58 views

apache rewrite debian vs windows

I have simple rewrite rules as I just learned about them RewriteEngine On RewriteRule ^dl/(.*)/.*$ dl/$1/index.php [L] RewriteRule ^index.php$ upload.js [L] both are working on Windows for url ...
cikatomo's user avatar
  • 149
0 votes
1 answer
2k views

RewriteMap syntax Regex

in my .htaccess i've tons of directives, with same syntax: RewriteRule ^(.*)/PRODUCT_1.aspx http://www.site.com/product.php?id_product=2891 RewriteRule ^(.*)/PRODUCT_2.aspx http://www.site.com/...
CalfCrusher's user avatar
0 votes
1 answer
3k views

mod_rewrite and redirecting on exact match [duplicate]

Possible Duplicate: Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask? I want to redirect http://www.name.com and http://name.com/ to http://my.name.com/. ...
Michael's user avatar
  • 506
0 votes
1 answer
884 views

How to redirect ServerAlias - requests to ServerName and obey the subdirectories in the requests?

I want redirect all traffic to example.com/* to be redirected to www.example.com/* I found How can I redirect any ServerAlias to the respective ServerName? which handles the topic in question and did ...
BudwiseЯ's user avatar
  • 125
0 votes
1 answer
109 views

Apache URL rewriting

Say I have content in www.domain.com/products/ In the products folder, I have several html files all starting with "big-". For example: big-product01.html big-product02.html How can I rewrite my ...
MrUpsidown's user avatar
0 votes
1 answer
989 views

Apache doesn't recognize .htaccess

I'm a little bit confused; my Apache2 doesn't read any of my .htaccess. I'm using Ubuntu 12.04 and the last line of my etc/apache2/apache2.conf looks like that: <Directory /> Order Deny,Allow ...
Poru's user avatar
  • 25
0 votes
1 answer
719 views

Mod rewrite subdomains based on query string

I gave localhost an alias: 'myhost'. Entering 'myhost' in my address bar shows me /var/www/index.php. So far so good. Set up an apache virtual host on /var/www and called it 'myhost', then added three ...
bee.catt's user avatar
  • 235
0 votes
1 answer
87 views

I am using mod_rewrite and am using a rewrite rule, is there a way for me to get the URL as seen in the address bar server side?

I can reconstruct the actual URL post rewrite rule, but is there a way for me to get the URL pre rewrite rule? Also, when I run php in IIS 7.5, and have rewrite rules in my web.config, how do I get ...
Robert Louis Murphy's user avatar
0 votes
1 answer
69 views

Subdomain redirect to file

Here is my htaccess: RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+?)\.imvu-e\.com$ RewriteCond /var/imvu/products/ht/clients/%1/ -d RewriteRule ^(.+) ...
ParoX's user avatar
  • 302
0 votes
2 answers
11k views

Mod_rewrite not working on ISPConfig 3 Server [closed]

Problem I recently migrated a Drupal site from a shared hosting server to my own VM. Everything appears to work correctly, except clean urls. My VM Setup Ubuntu 10.04 LAMP ISPConfig 3 What I've ...
Akahadaka's user avatar
  • 113
0 votes
1 answer
87 views

.htaccess rewrite issue

Below is my .htaccess file for my website on shared hosting - I'm attempting to send all requests to index.php with parameter 'q' where I wish to parse data etc... unless it's an existing file or ...
Jessica's user avatar
  • 103
0 votes
1 answer
315 views

Is it possible to mod_rewrite the full url or mask the actual url altogether?

I've been looking at the Heroku custom domain feature, which enables to change a url from subdomain.heroku.com to www.whatever.com. Is something like this possible with mod_rewrite or how is ...
frequent's user avatar
  • 167
0 votes
1 answer
172 views

make apache mod_rewrite rols dynamic from db?

i have mod_rewrite rols that hard coded and i want to make it dynamic can i fatch somehow the users names from db ? or other variables i define in the config file ? ? this is what i have now : ...
user61104's user avatar
  • 529

1
26 27
28
29 30
45