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
2 answers
609 views

Adding apache rewrite rules to a large number of vhosts

To fix a security problem I need to add some rewrite rules to all our virtual host configurations. Are there any options adding rewrite rules to all virtual host declarations besides updating to ...
BetaRide's user avatar
  • 445
0 votes
1 answer
435 views

Apache Rewrite not rewriting as expected

I'm trying to use mod_rewrite to redirect users to the HTTPS equivalent URL unless the URL is for my Jenkins CI server. Here is the rule I have in my default site config (my Jenkins and other sites ...
John S's user avatar
  • 135
0 votes
1 answer
1k views

apache2 rewrite rule on index.php only works if index.php is typed in

RewriteRule ^index.php/(.*)$ redirect.php?s=$1 Works with website.com/index.php/something But not with website.com/something Any way to get this to work? RewriteRule ^/(.*)$ redirect.php?s=$1 ...
natli's user avatar
  • 245
0 votes
1 answer
285 views

nginx rewrite rules for cached images

we are currently migratiing all services from apache2 to nginx but are currently stuck with a specific rewrite rule. The rule in apache is checking if a cached image/thumbnail exists and if so, ...
shakalandy's user avatar
0 votes
1 answer
4k views

Lighttpd can not start when including mod_rewrite

Here is my server modules list (modules.conf), its working without any problems, and lighttpd is running correctly while using this list: server.modules = ( "mod_access", # "mod_alias", # "...
Cyclone's user avatar
  • 260
0 votes
2 answers
674 views

Apache mod_rewrite for aaa.bbb.ccc.com to aaa.org

I'm trying to write my mod_rewrite rules in my .htaccess file to fix the URL that shows up in the browser bar when visitors to to my site. I have a few options that I want my users to be able to enter....
Kyle Oliveira's user avatar
0 votes
1 answer
232 views

mod_rewrite rule to match first letter

I have urls structured like this http://domain.com/search.php?query=perks I want to be able to match the first letter of the query "in this case perks" and make a url like this http://domain.com/p/...
chris's user avatar
  • 113
0 votes
1 answer
514 views

.htaccess RewriteRule works on addon domain but not root domain

I made a .htaccess in an addon domain, which successfully hides the wp-admin folder: # Hide wp-admin <ifModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTP_USER_AGENT} !...
harvest316's user avatar
0 votes
1 answer
337 views

mod_rewrite works when accessed internally but not externally

I'm using the following mod_rewrite rule in apache config to force all traffic through https: RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} This is ...
William W's user avatar
  • 127
0 votes
1 answer
731 views

apache virtualhost: Auto subdomain with exception

I've been searching for a way to automatically redirect domains to a specific folder, and fond a good answer here on serverfault: Apache2 VirtualHost auto subdomain. (The accepted answer) So far ...
Henrik Karlsson's user avatar
0 votes
1 answer
4k views

mod_rewrite replace character

I know this should be the easiest thing in the world, but I just can't get my head around rewriting and I have to do it so infrequently that I end up trawling Google for hours.... I'm consolidating ...
Gary's user avatar
  • 103
0 votes
1 answer
987 views

Apache mod_rewrite behaves differently on SSL and non-SSL configs

I have a system where I'm hosting a number of SSL sites on my server. I also need to setup OAuth for each domain, with Google and Yahoo in particular. They each require verification files be installed ...
Aaron Vegh's user avatar
0 votes
2 answers
11k views

Rewrite IP address of a host to another IP address with .htaccess

I have to redirect content on a webserver with a hostname (mydomain.com) from current IP (123.123.123.123) to a new IP (234.234.234.234), while keeping the same hostname, using .htaccess. How can I do ...
Yusuf's user avatar
  • 205
0 votes
1 answer
170 views

301 redirect (mod rewrite) a whole folder and all files with the get parameters

I want to redirect all urls starting with www.site.com/online/ to www.site.com some examples of the files I'm trying to redirect are ... www.site.com/online/folder1/folder2/folder3/?gdt=...
Sava's user avatar
  • 1
0 votes
1 answer
233 views

htaccess url rewriting for 1 folder

My .htaccess file works fine for everything expect 1 specific folder. As result, http://www.mydomain.com/administration/index.php unexpectedly goes to 401 error page instead of loading index.php from ...
Haradzieniec's user avatar
0 votes
2 answers
1k views

Turn …/?token=xx-xxx into …/xx-xxx

I have a htaccess-file that removes index.php (codeigniter). I am having a problem with Paypal, cause the return url is using query strings, which are troublesome in codeigniter. This is my htaccess-...
Øyvind 's user avatar
0 votes
2 answers
496 views

Cant get RewriteCond rule to work in mod_rewrite

I have the following path: http://www.domain.com/cgi-bin/hsrun.exe/Distributed/Postphil/postphil.htx;start=DetectLanguage?Language=LANG_Icelandic If the path contains the folder /postphil I want to ...
Sigurdur's user avatar
  • 103
0 votes
1 answer
433 views

Apache server different DocumentRoot for specific IPs [duplicate]

Possible Duplicate: Apache virtual host based on source IP For a certain visitor, identified by an IP, how to server contents from different DocumentRoot?
Pentium10's user avatar
  • 444
0 votes
1 answer
2k views

URL with trailing slash 404, appending index.php or ?someString works

Recently I've encountered an issue where some pages 404 when accessed via their cruftless paths. The same pages work when a query string, like ?1234 or index.php is appended to the path. Example: ...
Michael Robinson's user avatar
0 votes
2 answers
447 views

htaccess rewrite rule

Well i have this code into my .htaccess file Options +FollowSymlinks RewriteEngine on AddDefaultCharset UTF-8 RewriteCond %{THE_REQUEST} ^[A-Z]+\ (.+)\.php [NC] RewriteCond %{...
user726730's user avatar
0 votes
1 answer
3k views

Why isn't FastCGI able to properly process PATH_INFO rewrites?

My current host uses FastCGI for its PHP setup, and this is apparently causing some issues when a mod_rewrite directive redirects to a URL with a PATH_INFO portion. For example, there are issues when ...
AgentConundrum's user avatar
0 votes
1 answer
2k views

Apache2, mod_proxy, mod_ssl on OSX not working

I am trying to setup apache2 on OSX and am having an issue. I am trying to proxy a domain to 127.0.0.1:8081 (which is up and running) but when try to load through apache I get a "Web Page Not Found". ...
maclema's user avatar
  • 191
0 votes
1 answer
297 views

Why isn't excluding a folder in mod_rewrite not taken in account

I would like to exclude mod_rewrite for a certain directory. I want the folder "phd_application" not to be rewritten, that is, when a url points to www.myserver.com/phd_application it goes to ...
kaklon's user avatar
  • 177
0 votes
1 answer
80 views

Htaccess Mod-Rewrite Not Rewriting

#Hide Index IndexIgnore * #Define ErrorDoc ErrorDocument 404 http://www.domain.com #REDIRECTS Redirect 301 /page.php http://domain.com Redirect 301 /inc/page.php http://domain.com Options +...
rrrfusco's user avatar
  • 103
0 votes
1 answer
163 views

Redirect URL including folder path

I have the following rewrite rule setup: rewritecond %{http_host} ^domain.com [nc] rewriterule ^(.*)$ http://domain2.com/$1 [r=301,nc] Now this works for redirecting domain.com/index.htm to domain2....
Luke's user avatar
  • 183
0 votes
2 answers
266 views

Redirect Rule for All Requests that Come with A Specific Server Alias

I am trying to write a redirect rule that will send all incoming requests directed at given server alias. Below is what my .conf file looks like. I am having problems with the first rule associated ...
Spencer's user avatar
  • 221
0 votes
1 answer
839 views

.htaccess rewriteCondition for one special directory while all other requests go through

I am new to mod_rewrite. My problem: I have two rules colliding with each other. In my doc root I used to have only one .htaccess redirecting all incoming requests to a fast-cgi script like so: ...
j7nn7k's user avatar
  • 131
0 votes
1 answer
1k views

Debugging/Developing tool for apache's mod_rewrite (Rewrite Engine) [closed]

Is there any tool (GUI or online) for developing and debugging apache's mod_rewrite (Rewrite Engine) rules? Something like Regex tools that get input (for example URLs per line) and some rewrite rules;...
Ariyan's user avatar
  • 147
0 votes
1 answer
98 views

mod_rewrite not working?

I have a bunch of non-existent urls that need to be redirected to new ones, though they are not working... mod_rewrite does work and is enabled, I'm wondering if the redirect URL has to actually exist ...
Sean Kimball's user avatar
0 votes
2 answers
91 views

Rewriting rule to prohibit image linking from another server [duplicate]

Possible Duplicate: How to prevent hot linking (“image theft” / “bandwidth theft”) of ressources on my site? I'd like to forbit image linking on my server. That means if ...
Bevor's user avatar
  • 113
0 votes
2 answers
221 views

Rewrite/Proxy silently to a non-secure domain

Is there some way to silently, internally, redirect all pages to another server? I have a site on Site5's server "huckleberry". I can reach the page - with a SSL certificate - via the path to their ...
SamGoody's user avatar
  • 111
0 votes
2 answers
699 views

Apache - Redirect to a bootstrap

Apache2 CentOS 6 I am trying to work out how to make an Apache VHost send all of its requests to an index page as a kind of bootstrap. I do not wish to alter the look of URL, however all requests ...
Lee's user avatar
  • 155
0 votes
1 answer
1k views

Apache rewrite with intermediate proxy server (with authentication)

Using Apache 2.2, I'd like to access an external server (reachable through the Internet) from one of my internal servers. The URLs will be rewritten to change the host so I'll either use mod_rewrite ...
Snark's user avatar
  • 181
0 votes
2 answers
1k views

need to redirect to static url based off of string patter match in uri

I have siteminder protecting an Oracle ADF java faces app. It appears I am going to have to intercept an http reqeust for the logout link delivered by Oracle in order to kill the siteminder session. ...
organicit's user avatar
  • 115
0 votes
1 answer
352 views

Mirroring my website through a secure subdomain

Attempting to get my site to comply with the limitations of an edge content delivery network, I have been forced to push my security certificate root from https://www.mysite.com to the subdomain https:...
Josh's user avatar
  • 119
0 votes
2 answers
750 views

What do these rewrite lines mean? [duplicate]

Possible Duplicate: Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask? What do the following lines mean? I am sorry, I am a new learner of regular expressions. ...
user avatar
0 votes
2 answers
136 views

Optimal mod_rewrite regex. Does the way the matching patterns are arranged inside the regex matter?

I have the following: RewriteRule ([a-zA-Z0-9]{5})?/load_page/([0-9]+) Which arrangement would be optimal for the regex: RewriteRule ^/([a-zA-Z0-9]{5})?/load_page/([0-9]+) OR RewriteRule ^/...
Catalin's user avatar
0 votes
1 answer
121 views

Redirecting all request to a specific folder, works except for SSL doesn't?

I have a folder on my server called john. Inside this folder is an application I am working on. I have a self signed cert installed. if I go to https://mydomain.com/john/signin it works. I have an ...
JD Isaacks's user avatar
0 votes
1 answer
815 views

301 redirects with multiple domains

I'm currently running a website which has a 'multi store' feature, which essentially means that the single site handles multiple domains. In this instance, I have domain-a.com and domain-b.com both ...
Geoff's user avatar
  • 3
0 votes
1 answer
637 views

mod_rewrite help - subdirectory turned into subdomain

I had http://example.com/intranet/ which I had to turn into http://intranet.example.com Unfortunately, everything was written with the absolute path so its like <a href="/intranet/timeclock">...
Harry Forbess's user avatar
0 votes
1 answer
5k views

.htaccess url rewrite to stop bingbot immediately

I want to stop bingbot completely and immediately . I'd like to do this using mod_rewrite in .htaccess. I've got these rules ... Options +FollowSymLinks RewriteEngine on RewriteCond %{...
glaucon's user avatar
  • 253
0 votes
2 answers
290 views

rewrite url /v1/json/acount to ?v=v1&f=json&t=account

How can I rewrite this url api.domain.com/v1/json/account?id=123 to api.domain.com?id=123&v=v1&f=json&t=account RewriteCond %{HTTP_HOST} ^(api)\.[^\.]+\.[^\.]+$ [NC] RewriteCond %{...
clarkk's user avatar
  • 2,085
0 votes
1 answer
60 views

Help with simple mod_rewrite needed

My site uses mod_rewrite for most URL's within the site. eg. domain.com/contact.htm domain.com/product/details.htm I've had domain.com/contact.htm working for a long time and is quite simple, but ...
user avatar
0 votes
2 answers
158 views

Multiple custom redirects with apache

I would like to set up multiple redirects using apache but am completely stumped as to how to do it? I have a nodejs instance which serves up my home page running on my server on port 4000. It can ...
mrwooster's user avatar
  • 243
0 votes
3 answers
58 views

porblem in Mod rewrite url editing [duplicate]

Possible Duplicate: Make post title as a slug in url by mod rewrite I have a url: http://www.example.com/details.php?var=100&p=99 I want to rewrite it as using mod rewrite http://www....
SohailRajput's user avatar
0 votes
1 answer
759 views

Htaccess: Rewrite a subdirectory within a domain to the main domain

I have to rewrite a sub directory to go the main domain. For example, I have www.mysite.com and I want to rewrite www.mysite.com/newersite to www.mysite.com This is what I used in my htaccess file: ...
gdinari's user avatar
  • 101
0 votes
1 answer
57 views

redirect for a just rewrited url

i've got this sample rule: RewriteRule ^stories\/([0-9]+)\/(.*)+ stories/index.cfm?id=$1 and this works perfect. now, i would redirect one page (just rewrited) to another: Redirect 301 /stories/...
Roberto's user avatar
  • 113
0 votes
1 answer
110 views

mod_symlink or something to deliver files from outside the doc root?

I'm wondering if there is an apache mod that can handle delivering files outside of the document root? My specific example is that I would like to, in my vhost config if possible, rewrite ROBOTS.txt ...
DanH's user avatar
  • 857
0 votes
1 answer
152 views

MOD_REWRITE recipe: /agencyname TO /appname/login.jsp?a=agencyname [duplicate]

Possible Duplicate: Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask? I am looking for a recipe for a mod_rewrite rule that will accomplish this: MOD_REWRITE ...
djangofan's user avatar
  • 4,200
0 votes
1 answer
43 views

Mod Rewrite, moving a website with rules

I have a few sites that I want to move to a development server that all have hard coded values that look for static files at /. Is it possible if I read the HTTP_REFERER variable to reveal example....
jbcurtin's user avatar
  • 115

1
31 32
33
34 35
45