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

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…
0
votes
1 answer

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 the URL localhost/mo/api to enable the rewrite…
user1908375
  • 133
  • 4
0
votes
0 answers

Apache mod_proxy redirect with absolute domain

I am using the example from apache to rewrite a url with proxy: RewriteRule ^widget/(.*)$ http://product.example.com/widget/$1 [P] I want to set a absolute domain for this: RewriteRule ^de.domain.com/widget/(.*)$ …
Mutatos
  • 111
  • 4
0
votes
2 answers

Decrypt a Header in Apache (HTTPD)

I've been asked to have a look at whether it's possible to decrypt a header during the processing of the request. The specific use case is to respond to the decrypted contents of the header by removing another header from the request (if the…
ianxh
  • 11
  • 1
0
votes
1 answer

Can I not setup multiple redirects using apache?

I have single web application on the server with multiple domain names (pittsburgh-app.com, philadelphia-app.com, etc). Now the domain names are changing to (new-pittsburgh-app.com, new-philly-app.com, and so on). So when I setup the following…
Rayhan Muktader
  • 103
  • 1
  • 3
0
votes
2 answers

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 perfectly when I was on a server with Apache…
mittelmania
  • 209
  • 2
  • 10
0
votes
1 answer

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 ServerName www.example.com ServerAlias example.com *.example.com
Arturo
  • 423
  • 3
  • 6
  • 20
0
votes
2 answers

Mod_Rewrite recipe

I need to accomplish the following with mod_rewrite: URI request: http://domain.com/user/username/ or http://domain.com/user/username URI translate: http://domain.com/?q=user/username This needs to be very specific, with no wildcards. Could an…
user1797
0
votes
1 answer

How do I remove index.php from url in CodeIgniter 2.2

I have tried all the methods I can find on the web but nothing seems to work. I still get a 404 page. I already modified $config['index_page'] = ''; and add the lines to .htaccess as suggested by the ci documentation site. Please help. I am stressed…
0
votes
2 answers

Apache mod_rewrite : RewriteRule to pass requests tomcat application

I am having difficulty defining a correct RewriteRule to forward requests to an application running in tomcat. I have apache with mod_rewrite enabled as well as tomcat setup with an application mounted with mod_jk. Without a virtual host, I can…
Mike Croteau
  • 101
  • 4
0
votes
1 answer

mod_rewrite in .htaccess and basic auth in vhost - access to paths

I want to lock down a website (made on Drupal) with basic auth. Drupal is using mod_rewrite in its .htaccess file. The problem I'm facing is this - my virtual host looks like this: ServerName…
0
votes
0 answers

How to rewrite request for subdirectories using apaches' mod_rewrite?

My document_root is /home/john/public_html. I need the URL example.com/subdir/index.php to be handled by the file /home/john/public_html/index.php. This is what I put in /home/john/public_html/.htaccess: RewriteEngine on RewriteRule ^.+$…
GetFree
  • 1,500
  • 7
  • 23
  • 37
0
votes
1 answer

Chain rewrites of Apache requests for VirtualHost to another server in same network

Here is basically what I would like to do: http request comes in, portforwarding in router sends it to a server in the local network (server A) the server identifies the request for a virtual host server a has a rewrite rule for that virtual host…
Preexo
  • 194
  • 7
0
votes
0 answers

simple conditional mod_rewrite for redirecting wrong urls

I have an assignment to add storeId parameter to wrong urls. It should behave like this: If url has directorystore/a in it like www.example.com/store/a - the next directory in path has to be www.example.com/store/a/dir1…
0
votes
1 answer

mod_rewrite combine these two rules into one

I have two rules that currently function as they should, but I feel like they can be consolidated into one for the benefit of a smaller config to maintain and less rules to process for each HTTP request. The rules: RewriteRule ^/user/[0-9]+/?$…
imaginative
  • 1,971
  • 10
  • 32
  • 48
1 2 3
99
100