mod_rewrite is a URL rewriting module for the Apache web server. It is commonly used for so-called "pretty" URLs because of its ability to redirect on the server side (transparent to clients and their browsers), but also provides the power and flexibility to perform various request handling tasks ...

learn more… | top users | synonyms

3
votes
1answer
42 views

Redirecting specific URL from HTTPS to HTTP

Long time lurker, first time caller... I have a backend like admin.mysite.com which is able to use HTTPS (has a certificate installed, etc) - but that admin portal is a CMS backend for a number of ...
3
votes
1answer
30 views

Apache mod_rewrite problem with adding a query string on an internal rewrite

I need to replace /xyz with /index.html?dh=xyz. I use the following config in httpd.conf: RewriteCond %{QUERY_STRING} "!dh" RewriteRule "^/(.*)$" "/index.html?dh=$1" [R] This works perfectly if [R] ...
2
votes
1answer
402 views

Apache htaccess - modify query string with mod_rewrite

I've recently changed scripting on my website, and this has resulted in a few 404 errors as some very old queries are no longer being redirected correctly. I've been trying to create a rewrite rule ...
1
vote
1answer
38 views

How to regex a url to redirect user

Using the regex and the .htaccess file, I want to redirect users to a certain URL. I want to redirect: http://www.example.com/* but not http://www.example.com/CDadmin/* I have tried the ...
1
vote
1answer
57 views

enable keepalive on apache 301 redirect pages

I want to make it so that every website on the server I manage (including my own website) will enable keep-alive on all (HTTP status 301) redirect pages including ones issued by apache modules. This ...
1
vote
0answers
6 views

Passthrough in Virtualhost not preserving the previous URL

I have a RewriteRule written at Apache to redirect to TOMCAT. Passthrough [PT] doesn't seems to work and Getting Bad Request. Same configuration works with [P], but I don't want tomcat PORT to be ...
1
vote
0answers
63 views

Rewrite rule is causing a redirect to another host and port rather than showing the content at the current URL

I have a web application working on: next3.info:83 I want to go there with weburen.next3.nl so I used this code: RewriteEngine on RewriteCond %{HTTP_HOST} =weburen.next3.nl RewriteCond ...
1
vote
0answers
31 views

Using mod_rewrite to force users to use our caching proxy

During a recent audit we became aware of several users who have not set their DNS records to correctly point to our name servers. Since we don't control the domain names of our users directly, we're ...
1
vote
0answers
37 views

mod_rewrite cause errors in apache error.log

In Opencart I have enabled SEO URLS, which is working fine, unless that I see errors in apache log: [Thu Apr 16 22:53:38 2015] [error] [client xy] File does not exist: ...
1
vote
0answers
120 views

Redirect query string URL via .htaccess

I am trying to redirect all query strings to a new URL. Search query example www.example.com/?s=cars to resolve to www.example.com/?search_gcse/?q=cars ("cars" is just an example). What is the ...
1
vote
0answers
80 views

Using .htaccess rewrite rule that doesn't run for specific folders and files

I want to create a .htaccess file that reads index/somepage as index.php?q=somepage. This is how far I got: Options -MultiViews RewriteEngine On RewriteCond %{REQUEST_FILENAME} ...
1
vote
0answers
213 views

Can Apache .htaccess convert the percent-encoding in encoded URIs from Win-1252 to UTF-8?

I want to add a directive in my .htaccess, such that if the browser is pointed at a URI containing %E4 (ä) - or any other special character - the .htaccess automatically rewrites %E4 (ä) as %C3%A4 ...
1
vote
0answers
715 views

URL rewrite issue with cakephp

I am using cakephp framework 2.2.2 I want to create personalize URL for user if user enter username=pragnesh then they can access my site like http://pragnesh.mylocalhost.com same as in ...
1
vote
0answers
61 views

Two stage Apache rewrite not working

I had a list of "Redirect permanent path/to/url1 http--//domain2.com/path/to/url2" rules working as a test, but when I attempted to couple them with mod_rewrite rules to catch non-matching domain1 url ...
1
vote
0answers
122 views

Clean URL using index files or mod_rewrite

Is it better to make clean URL's using index files in directories or simply using mod_rewrite rules to remove the file extensions?
1
vote
0answers
315 views

Is my .htaccess rule creating an infinite loop?

Whenever I type a made up address that includes a directory index it removes it. The problem is when the the address includes a forbidden subdirectory. It reduces itself until it hits forbidden. How ...
1
vote
0answers
61 views

optimize htaccess

I have two condition which are conflict RewriteRule ^patients/findadoctor/(.*)\.html$ subcategorydoctor.php?id=$1 [L,NC] and RewriteRule ^patients/findadoctor/(.*)\.html$ ...
1
vote
0answers
321 views

Mapping different users to folders with mod_rewrite

I'm setting up a DAV server with Apache 2.2 and would like, if at all possible, to be able to redirect a user to their own folder without having per-user URLs, if at all possible. So I point a user ...
1
vote
0answers
142 views

Apache, Rewrite Rule and Directories

I'm using the current virtual host: <VirtualHost *:80> ServerAdmin webmaster@mysite ServerName example.co.uk ServerAlias www.example.co.uk DocumentRoot ...
0
votes
0answers
38 views

How to add http:// prefix to subdomain redirect in htaccess

I am rewriting a subdomain URL with a query (cart.example.net/ProductDetail.jsp?LISTID=7C0400-1101763508) to a www subdomain (www.example.net/product-category/product). The problem I am facing is the ...
0
votes
0answers
57 views

Moving rewrite rules to virtualhost tags instead of directory tags

Currently, I have my rewrite rules in what I believe is in the Directory context. My relevant part of httpd config file is similar to the following: <virtualhost nnn.nnn.nnn.nnn:port> ...
0
votes
0answers
31 views

The ultimate recipe to end duplicate content

I decided now its time to fine-tune my apache configuration to finally/hopefully end the duplicate-content madness. I notice the more I pay attention to this, the more income I make from ads. This ...
0
votes
0answers
38 views

Hosting htaccess redirect subdirectory to subdomain

I have simple hosting plan with domains included: Now I have the domain.com and seconddomain.com now I want to use all that domain and give them his own root directory. If I use the controle panel ...
0
votes
0answers
210 views

Using mod_rewrite to set cookie and modify domain name

I have two editions of a website. The mobile and desktop version. All desktop sections of the website have normal urls and mobile sections have subdomain urls suffixed with the word mobile. Example: ...
0
votes
0answers
138 views

How to allow access to subdirectory in website using htaccess?

I am wanting to create a seperate directory for my analytics program to function. My website is www.loosebruce.co.uk and I want my directory to be accessible as www.loosebruce.co.uk/analytics The ...