I am using the Zend Framework, and I use the .htaccess for some settings. I am now writing command line scripts for scheduling (e.g. cron). Command line scripts don't look at the .htaccess file because they're not served up by Apache. I would like to parse the .htaccess with my script to retrieve some settings. Here are the lines I'm...
I have used the following rule to allow our static domain to host fonts, but I've run into a problem font's not being used by the browser (firefox, safari) when the browser cache is enabled.
<Directory "/site/http/web/assets/fonts">
<FilesMatch "\.(eot|otf|woff|ttf)$">
SetEnvIf Origin "^http://(.*)?main-domain.co...
This row will certainly cause a little collision as it will try to rewrite the goal itself:
RewriteRule ^/(.*)$ page.php?q=$1 [L,NC]
Now, how do I prevent this?
...
found answer, see end of the post
How do you restrict access to a file by IP, when you are hosted in a cluster/cloud environment (Rackspace Cloud, to be more specific). Yesterday, I asked a similar question here, and received the following answer, which worked great (thank you) in my local test environment.
<Files test.html>
Order...
I have a directory full of email forms in various subdirectories, linked by various people in various places. I recently found a security problem in some of the forms, and I've taken them all offline, but now when people go to the links they get 404 errors. Is there an easy way, with .htaccess perhaps, to redirect any request for mydom...
hi guys,
i want to redirect
http://abc.com/a to /mypage.php?par1=a and
http://abc.com/a/b to /mypage.php?par1=a&par2=b
how can it be done?
...
I know that I can add expires header using mod_expires. However, what can I do if the Apache server doesn't have mod_expires installed and I don't want to route the access to the files through a scripting language like PHP?
...
Hi There,
I'm re-writing a subdomain to a 'folder' - actually a page in wordpress, and this all seems to be working correctly. I don't want the address in the URL bar to change though.
Everything works fine unless the user does not put a trailing slash after the page name, then the page is still redirected to the correct URL but the U...
I need something like this:
SetEnv foo bar.baz
RewriteEngine On
RewriteCond %{HTTP_HOST} ^%{foo}$
RewriteRule ^(.*)$ http://www.foo/$1 [L]
UPD:
I have made as follows:
SetEnv HOSTNAME_ENV testsite
RewriteEngine On
RewriteCond %{HTTP_HOST} ^%{ENV:HOSTNAME_ENV}
RewriteRule ^(.*)$ http://www.%{ENV:HOSTNAME_ENV}/$1 [L,R=301]
But it d...
I setup a local website using mamp, there are other sites I run in development on the same mamp install and I use links on my site like <a href="/about">About</a>
It will direct the user to http://localhost/about, but I need it to direct to http://localhost/chuck/host
chuck is the folder that this site is within, file path: /Applicatio...
i have a site that is on a darwin server.
i dont see any .htaccess.(i can see .htaccess file in a different site on the same server.)
yet it redirects /file to /file.php
how is this done?
...
I have setup htaccess but i want increase the length of the rule so i need to know can i bypass one files, its currently 4 but i want to extend to 11- file i want to bypass is called shorten.php
can i name a file that escapes the rule?
RewriteCond %{REQUEST_URI} \/([0-9a-z]{4})$ [NC]
RewriteRule ^(.*) http://www.x/forward.php?%1 [L]...
I have and index.php page in my root that simple directs to what I would consider my homepage,
like so:
<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: /lake-district-cottages/" );
?>
is it best to just remove the index page and set my true index in my htaccess or is it required that I have a file called index?
...
Hi, I've come across an issue today where a specific page on my site is sometimes causing a 500 internal error. The page normally can take fairly long to load due to some database queries on large datasets, but only today has the apache 500 internal error started to happen. Obviously I will try to optimise the db queries as much as possi...
I have a page with urls with lot of variables, for example:
http://dev.resihop.nu/addtrip?from=stockholm&to=goteborg&when=2010-09-06&got_car=1
How do I make it so that it instead gets written like this:
http://dev.resihop.nu/addtrip/from/stockholm/to/goteborg/when/2010-09-06/got_car/1
extra awesome features! (I'd be really...
i used to host my site at www.mysite.com/here
now the url is simply www.mysite.com
so how do i properly redirect all old links from say www.mysite.com/here/about
to www.mysite.com/about
thanks.
...
I have the following list of URLs to rewrite:
1 write url
/products/client/
send to
/basedir/system/index.php?client=cliente
2 write url
/product/client/index.php
send to
/basedir/system/index.php?client=cliente
3 write url
/products/client/image/dir2/myimage.jpg
send to
/basedir/system/image/client/dir2/myimage.jpg
4 ...
Hi there,
I would like to have
eg.
www.domain.com/api/json/implode/abc/and/a/b/c...
equal to
www.domain.com/api/jason/?method=implode&key=abc¶m1=and¶m2=a¶m3=b¶m4=c...
cheers
James
...
Hello,
I am using the readfile function to read image files. It works in most cases except when an image is located in a directory with htaccess file.
Here is an example:
header("Content-type: image/jpeg");
ob_clean(); // clean output buffer
flush(); // flush output buffer
readfile("http://127.0.0.1/WebProjects/project1/data/media/im...
Hi,
I would like to decode requested URL via .htaccess/mod_rewrite and forward it to my PHP application. I am making request to some remote service and I need to preserve the URL for redirecting after processing the remote request. I am handling it over in forward GET parameter so I need to encode it via urlencode. I would like it decode...