mod-rewrite

htacces proxy rewrite howto

Hi, I have a bit of a problem. I have 4 domains: www.myurl.com, myurl.com, www.myurl.de, myurl.de. Now my ajax posts only work on www.myurl.com. I would like to send all requests to this url without changing the url in de adress bar. This is done by a proxy rewrite(?) but I can't manage to get this fixed and I need some help ... I wou...

Using mod_write to redirect domains in URL to php script

I am trying to use mod_rewrite to redirect a domain in the site URL to a php script. For example: http://example.com/http://somedomain.com should redirect to: http://example.com/test.php?domain=http://somedomain.com I have tried to do this with the following RewriteRule RewriteEngine On RewriteRule ^(.*)$ /test.php?domain=$1 [L] ...

Apache Rewrite: Always use HTTPS (how to add an exception)

On mydomain.com, I currently keep all of my apache conf files in: /etc/httpd/conf.d/ In there I have a file called alwaysHttps.conf that contains: RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} I have a bunch of virtualhosts, and for one domain on the site: myotherdomain.com I would li...

rewrite rule for adding /MLM after URL automaticly

Hi, I'm trying to add a rule that will automatically add /MLM to the URL specified by the user. Thanks, RON ...

Apache mod_rewrite: explain me %{HTTP_HOST} expecially when using addon domains

Apache mod_rewrite: explain me %{HTTP_HOST} expecially when using addon domains Situation (directories tree) on an Apache server with addon domains: main-domain.com/ | |_ .htaccess (just an empty file, no rule in here) |_ index.html (shown when accessing http://main-domain.com) | |_ addon-domain-1.com/ | | | |_ .htaccess | |_...

mod rewrite and static pages

is possible to exclude a url being parsed by mod rewrite? my .htaccess has rewrite rules like RewriteRule ^contact contact_us.php and a couple more static pages. currently my site don't have troubles cause uses http://domain.com/user.php?user=username but now i need rewrite to: http://domain.com/username I've tried with: Re...

Mapping domains in a forward proxy

I'm currently running apache on my local machine as a forward proxy server. The config is pretty simple: ProxyRequests On ProxyVia On <Proxy *> Order deny,allow Allow from all </Proxy> However, if a user uses my proxy, I'd like to be able to map certain domains (without touching my hosts file or DNS) to certain directories o...

Passing values to htaccess

i have a htaccess file for redirection the redirected content is RewriteCond %{REQUEST_FILENAME} -location&action=photos&page=$ RewriteRule ^(.*)$ /sitename/view.php?link=$1&action=photos&page=&1 [L,QSA] The page numer is dynamically passing from the page How we can get the page number here pls helpme ...

RewriteCond Check if file exists in a subdirectory

I'm using Iirf v2.0. I have the following directory structure: / /library /library/index.php /webroot /webroot/images /Iirf.ini Where I have a library folder which contains my application, a webroot folder (which contains images, stylesheets etc) and an Iirf.ini config file. I'm wanting to redirect all requests to /library/index.php...

mod_rewrite with mod_jk, rule works on one server, gives a 404 on another

Hi all. I am using mod_jk and mod_rewrite on httpd 2.2.14. I have a rule.... RewriteCond %{REQUEST_URI} !^/video/play\.xhtml.* RewriteRule ^/video/(.*) /video/play.xhtml?vid=$1 [PT] I just want to rewrite something like /video/videoidhere to /video/play.xhtml?vid=videoidhere This works perfectly on my developer machine, but on produ...

Using IIS7's Rewrite Module and a database

My company converted from an old website to a new one and we have a bunch of old pages with URLs like this: www.example.com?foo.aspx www.example.com?foo.aspx?ID=B&utm_source=Foo www.example.com?foo.aspx?ID=C&utm_source=Foo Those URLs need to go to these pages respectively: www.example.com/ProductA www.example.com/ProductB?utm_sourc...

.htaccess url rewriting /project/Login to /project/public/index.php/Login without redirecting URL

I have this .htaccess code that works perfectly: <IfModule mod_rewrite.c> RewriteEngine on RewriteRule !\.(js|ico|txt|gif|jpg|png|css)$ public/index.php [QSA,L] </IfModule> ...but this code redirects to public sub directory. I don't know if it's possible to rewrite url without redirecting, just use /project/Login appointing to /pr...

Problem with htaccess file. Wordpress Plugin tells me there is one, I can't find one?

hey guys, i have an really unusual problem i've never had before. i've no .htaccess file on my server. looked everywhere, there is just no file, but a Wordpress Plugin (AskApacheRewriteRules) tells me that the following Rules are active: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond ...

URL Rewriting-Page display - rewrite rule in .htaccess

For URL Rewriting, i have got the output for static URL But , for dynamic URL , i am getting partial output only. I have placed the .htaccess file in the root directory only. Here is the code: Options +FollowSymLinks RewriteEngine on RewriteRule ^booking/price/([0-9]+)/?$ booking.php?price=$1 What will be the solution ? ...

mod_rewrite: rewrite specific URL

Hello. I want to rewrite a specific URL, I'll show an example so you'll understand what I mean. First, my current rewrite rule: RewriteRule ^/?([a-zA-Z0-9/-]+)/?$ /index.php [NC,L] Now I want this URL: http://example.tld/foobar?test Rewritten to: http://example.tld/foobar Note: only for /foobar?test! E.g. not for /somethingelse?t...

Modrewrite - virtualhost

I've got mydomain.com *.conf folder contains a few .conf files for subdomains and some virtual domains such as myotherdomain.com I want all requests to http mydomain.com to get redirected to https mydomain.com So I have this: RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} That works, b...

Rewrite base rule- php

Internal URL: example.com/abc/xyz/rule.php?price=1&pass=2 External URL: example.com/abc/xyz/rule/1/2 But the css, js files are not coming into effect in the external URL. My .htaccess file: RewriteEngine On RewriteBase /example.com/abc/ RewriteRule ^rule/([0-9]+)/([0-9]+)/?$ rule.php?price=$1&pass=$2 ...

htaccess rewrite rule 'page numbers' problem

Hi, I've added a .htaccess file to my root folder for the purposes of rewriting dynamic URLs into static ones. This seems to have been done successfully but I am having problems with page numbers. For example, if you were to visit a static page /widgets, the first page of the products is fine....but subsequent pages show up as /products...

jetty 6 rewrite handler not working web server

I cannot make rewrite handler to work on Jetty server 6.1.24. Here is my example in Scala: val server = new Server(8080); val contexts = new ContextHandlerCollection(); val rewriteHandler = new RewriteHandler(); rewriteHandler.setRewriteRequestURI(false); rewriteHandler.setRewritePathInfo(false); rewriteHandler.setOriginalPathAttribute...

Apache Rewrite Rule (Regex)

Hello fellow programmers, I'm using apache and i need to rewrite URL of type: /a/b/c/d/boundary/stuff* to: /boundary/a_b_c_d/stuff* I need to rewrite the first Uri to the second format. The number of elements before '/boundary' are variable and i want to replace all slashes('/') between elements by '_' The boundary word is...