Questions tagged [mod-rewrite]

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

For an introduction and examples of using mod_rewrite, read over the comprehensive article,
"Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask"

2224 questions
0
votes
1 answer

RewriteRule [E=let_me_in] and 'Require env let_me_in' don't work together

I have a problem similar to this: http://www.tek-tips.com/viewthread.cfm?qid=1144803 I'm trying to grant access, if specific RewriteRule triggered. Setting a var using [E] flag, but the var seems unset when the subsequent authorization step is…
basin
  • 558
  • 1
  • 5
  • 22
0
votes
2 answers

forbid cgi invocation by direct url, but allow via a RewriteRule

I want to allow anonymous client execute a script via a special URL, but not directly. Everything else should require auth. Require all granted RewriteRule…
basin
  • 558
  • 1
  • 5
  • 22
0
votes
1 answer

How is leading slashes handled in server and in client?

I am trying to create a RewriteRule, but it's unreliable and I can't figure out what is happening. Here's my rule: RewriteRule ^docs/(......)/$ index.php?docid=$1 [L] the problem is leading slashes, which I have heard is a troublesome thing. What…
Omar Saad
  • 111
  • 1
0
votes
1 answer

.htaccess not behaving as desired

Eventhough I'm new at htaccess, I've been learning a lot in the past few days, but I'm stuck on a certain part that resulted in the website not behaving as desired. Here is the part of the code where I have my delima: Options +FollowSymLinks…
elrayyes
  • 3
  • 2
0
votes
1 answer

System error in Apache with combination of https redirection plus password requirement plus error document

In an Apache 2 vhost I have the following configuration (in my case, in .htaccess of the document root (which is for simplicity the same for http:80 and https:443) RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*)…
Hagen von Eitzen
  • 824
  • 3
  • 17
  • 43
0
votes
1 answer

Redirect to Maintenance file with .htaccess

i'am trying to do a simple redirect to a maintenance page, but seems like apache won't let me do ! i have a folder for 3 version of a wiki (each with a specific language), so i want to redirect each wiki trafic to his own maintenance page. here is…
Froggiz
  • 3,043
  • 1
  • 19
  • 30
0
votes
1 answer

forward slash and mod_rewrite

This might be a stupid question but it took me days to even figure out what the problem was. I'm using mod_rewrite and passing values separated by forward slashes. The problem is that the forward slashes are changing the path (I think) So I'm…
0
votes
2 answers

mod_rewrite gives 404 error

I'm making a CMS and trying to convert post links to pretty ones like so: Original Link: http://localhost/index.php?id=13&category=Uncategorized&title=just-a-link Converted Link: http://localhost/13/Uncategorized/just-a-test I'm using Apache2 on…
0
votes
1 answer

mod_rewrite sending redirect loop when trying to redirect based on user agent

I am using Apache 2.2.3 (old version, I know) So I am trying to redirect based on older versions of IE (6 and 7 for now... ) and I am getting a redirect loop. I have: RewriteEngine On RewriteCond %{HTTP_USER_AGENT} "MSIE\ [6-7]" [NC] RewriteRule .*…
Vnge
  • 195
  • 3
  • 12
0
votes
1 answer

How to write more than one mod-rewrite rule?

I always used the following rule to manage urls: Options +FollowSymLinks RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^.*$ ./urlredirect.php With this I could easily check with php which…
Nightwolf
  • 121
  • 1
  • 6
0
votes
2 answers

How do I forward requests to another URL without actually changing the URL in Apache?

I have Apache running in a domain, for example http:// example.com. I also have Tomcat running on my server and I've forwarded all requests made to http:// example.com/t/ to Tomcat and all other URLs are served by Apache directly. My problem is I…
user21805
0
votes
1 answer

Stop processing and return to client immediatly in Apache

I have a Apache 2.2 that hosts a proprietary (commercial) authentication module. That modules looks at every requests and might let them through if they are flagged and "anonymous ok" in the back-end authentication software. One such anonymous…
ixe013
  • 1,018
  • 2
  • 10
  • 26
0
votes
0 answers

Problems loading CSS. Error.log prints: "Request exceeded the limit of 10 internal redirects"

I have issues on my server. When I do changes to CSS file they are not showed until one day later or more. I have seen the following error in the apache error.log: [Thu Jul 16 08:48:49.193132 2015] [core:error] [pid 30667] [client…
miganml
  • 23
  • 1
  • 1
  • 4
0
votes
1 answer

apache mod_rewrite rule not working

I'm testing the rule below else where and it's working but on my system it's not (centos 7, Apache/2.4.6) [I changed my domain to domain.com for the post here] the purpose of the rule is to rewrite http://domain.com/story.php?id=xxxx to…
moebin
  • 1
  • 2
0
votes
1 answer

Remove double URL encoding on URL

I have a third-party shopping cart set up on my server using PayPal for payments. When a user completes a transaction they are redirected to the URL https://example.com/?target=payment%255freturn&txn_id_name=txnId.... The correct URL should include…
colincameron
  • 103
  • 4