If have some rules in my .htaccess:
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l
RewriteRule ^.*$ - [NC,L]
RewriteRule ^assets/img(.*)/([a-zA-Z0-9-_\.]*)\.(.*)\.([a-z]{2,4})$ /assets/img$1/.$2.$4/$3.$4 [NC,L]
This causes /assets/img/path/image.jpg > /assets/img/path/image.jpg
The second rule: /assets/im...
I need a mod_rewrite rule to redirect url depending on the hostname they are comming from.
The situation:
We have multiple domains pointing to a same webspace and we need to restrict what the specific host can see/download.
domainname.com/images/logo.jpg and /www.domainname.com/images/logo.jpg should transform into domainname.com/doma...
Help please.
I am looking for the best way to replace the "X" (number) in this url
www.websitename.com/info.php?lid=x
the "x" is a numerical value - i would like to replace the "X" with the "name" field from my database.
Is mod rewrite the way to go? I have multiple urls of the same format (different "X" value of course at the end) ...
I would have thought this would be better documented somewhere, but cannot find much information on the subject.
Basically I'm using htaccess to instill 3 rules on the site i'm working on:
Redirect / rewrite non-www to www
Remove the extensions from each of the site pages - they're php files. Doing this means that the site index becom...
Hello!
Is there any work around to replace mod_rewrite to make Konstrukt framework runs smoothly?
Thanks!
Dio
...
I need to take down an entire site, so I want to route everything request to a landing page. What does the mod_rewrite look like for that? My directives are giving me a "can never complete" error in firefox.
RewriteEngine on
RewriteCond %{REQUEST_URI} !^[^.]*/$
RewriteRule ^(.*)$ /alert.php [R=301,L]
...
Hi there,
when my user logs in, I want the get variables that were sent rewrote onto the URL like so:
http://mysite.com/mygetvar1/mygetvar_value1/mygetvar2/mygetvar_value2/
or
mysite.com/mygetvar1=mygetvar_value1/mygetvar2=mygetvar_value2/
How can I do this?
Please help! Thanks!
...
How can I get anything but files to rewrite to index.php's params? I'm using apache, mod_rewrite, etc.
...
I am realy ,realy newbie in rewrite rules..
I have php script with a search form and with three imputs : title ; category ; region .
User can search by title category or region , so the parameters can not be in a specific order.Sometime they search by title sometime only by category an region...
my rules
RewriteRule ^list/(.*)/(.*)/(.*...
Hi,
my .htaccess in the root folder includes the following lines :
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)\.htm$ http://example.com/?city=$1 [NC]
when I open the address http://example.com/bla.htm, my browser doesn't hide the GET values specified in the .htaccess, it redirects me to ?city=bla. eventhough I'm not u...
Hello,
I'm new to server administration but I was able to get a LAMP setup running on my new VPS. I uploaded a few web files that work on my other server, but they seem to give me the error: "File does not exist" in my /var/log/apache2/error.log file. The homepage loads just fine through my scripting, but other pages don't.
.htaccess...
I run the following url:
http://localsite/index.php/foo/bar
index.php is executed and outputs variable:
$_SERVER[SCRIPT_FILENAME] = E:/path/to/file/index.php
mod_rewrite in Apache is disabled.
Who rewrites the rule?Or what happens?
How index.php is found? Why apache decided to run it?
My configuration:
Windows Vista, Apache Apac...
I am planning to integrate Apache httpd server with Tomcat using the proxy module to forward certain addresses to be processed by Tomcat. However I wanted to ask if it is possible to combine the output from Tomcat with content from apache httpd so that they are returned to the client as part of one html page? (no frames or funny business...
I would like to redirect to https using mod_rewrite only if certain conditions are met:
If the URL does NOT contain the word 'administrator'
AND the URL DOES contain the string 'xyz' (in any part of the URL, including the querystring)
This does not seem to work:
RewriteCond %{REQUEST_URI} xyz [NC,OR]
RewriteCond %{QUERY_STRING} xyz [N...
Hi,
Here is my setup :
I have a website located at www.cabsh.org/drupal
I want to use mod_rewrite to do 2 things :
Redirect www.cabsh.org to http://www.cabsh.org/drupal/index.php (I got this one)
Rewrite /www.cabsh.org/drupal/index.php to www.cabsh.org/site/index.php
I cannot figure how to achieve the 2nd point. I'm using .htacc...
I've read over the similar questions on stackoverflow, but have been unable to get this working. I keep getting stuck in an infinite loop.
I'm trying to redirect a specific url to a child of that url. eg:
Redirect 301 /category/parent-cat http://domain.com/category/parent_cat/child_cat
...
I'm using mod_rewrite to redirect people from one domain to another (whilst preserving the rest of the URL). Both domains point at the same codebase.
One of the directories has authentication controlled by a local .htaccess file.
These authentication directives get processed before the mod_rewrite rule are processed. Therefore the clie...
How can I forward short-dom.com to long-domain.com ?
I keep seeing examples like:
RewriteCond %{HTTP_HOST} ^a\.com$ [NC]
RewriteRule ^(.*)$ http://www.a.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^b\.com$ [NC]
RewriteRule ^(.*)$ http://www.b.com/$1 [L,R=301]
But these don't allow me to specify my short domain (all combinations of it ...
I have a site arranged as follows with subdomains as subdirectories:
/ [webroot]
/subdomain1/
/subdomain2/
I'd like to create an htaccess file that rewrites all accessed files to maintenance.php w/ 503 message, but I'm not sure why the following does not catch the subdirectories?
RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_AD...
Hello,
Let's say I have the domain "example.com"
I would like to add a route such as when the URL is "example.com/whatever/follows" it redirects to "http://www.example.com/whatever/follows" (forwarding the query strings too).
Basically I would like to translate into Zend the following Apache Rewrite rule:
RewriteCond %{HTTP_HOST} ^exa...