.htaccess

.htaccess not routing to /public_html/

I seem to be having an interesting problem in that .htaccess isn't routing to /public_html/index.html by default as it should, and I'm getting a page not found error. I do know that someone tampered with the file recently but have no idea what they did and I unfortunately know nothing about routing. I tried to do some research but didn't...

What is wrong with this apache url htaccess rewrite rule?

I've got this: RewriteEngine On RewriteRule ^/redir?url=(.*)$ http://blah.$1 When I use this and go to the url that looks like: http://www.mydomain.com/redir?url=www.otherdomain.com It says the file isn't found on my server. I.E. no redirect. What I want it to do in the above example would be to redirect to: http://blah.www.othe...

Technique for setting images path?

Hello Example: <img src="/images/name.jpg" alt="" /> This is what I want: <img src="name.jpg" alt="" /> Upon request for the image, the image will not be found because it is in the "images" directory and not in the root where the HTML file is. Is there a way htaccess or any other technique will be able to recognise the http image...

YSlow & Google Page Speed's advice on .htaccess conflict

Thanks in advance for your help. I've been experimenting with YSlow and Google page speed, both provide very helpful advice and neither seems to have an advantage over the other but when it comes to Entity tags they seem to disagree or conflict in some way. The following code satisfies YSlows 'Configure entity tags (ETags)' pointer He...

Use .htaccess to force caching differently on specific page (index.php)

Currently I am using .htaccess to force cacheing across my website with the standard FileETag MTime Size ExpiresActive on ExpiresDefault "access plus 86400 seconds" But the content on my front page (just my domain.com) changes a lot more frequently, and I would like to either remove forced caching or set it to just a few minutes speci...

Rewrite only specific URL's through .htaccess

Hi All, I have created a front controller for my website. I want to pass all requests to the website through this front controller. Now I also have some other software installed in the web root and right now I am adding those folders to ignore via .htaccess so that their requests also don't go to front controller. I am doing something l...

mod_rewrite 301 redirect from old url to new codeigniter

Hi I have updated my website to now use the codeigniter framework my new urls are like the following example.com/index.php/home/page/page-title The old urls are example.com/index.php?option=com_content&view=article&id=249 Ideally I want to do a redirect for all links formatted in the old way to the new links but there are a lot of pag...

.htaccess rewrite mode is not working

rewrite script in .htaccess RewriteEngine on RewriteRule ^index/page/(.*)$ index.php?page=$1 It works in local machine. but in server it does not work. can any body help me? ...

Apache, PHP: send filename through $_GET

Hello, I'm having an upload Java applet to handle large files upload. The use of this upload is mandatory, so dropping it is not an option. The problem is that, after the upload, the applet redirects to a given url and sends some info through $_GET. I can't change that ( the sending method, the params order ). And the last param sent is...

How to 301 redirect all pages from one domain to one single page on a different domain.

Hi! I´m trying to do a 301 redirect in a htacess file. I want to point all pages on one domain to one single page on another domain and I do not want to manually redirect all single pages. Ex: www.olddomain.com/1.html and www.olddomain.com/2.html should both point to www.newdomain.com. Hope anyone could help me. ...

Facebook like usage of #! in url for content loaded through ajax

I am using ajax to load content for my site. When I dynamically load a page http//www.example.com/a/b/c I change my current page's url to http//www.example.com/xyz/#!/a/b/c by setting it through javascript using window.location Now what I want to do is that when somebody enters a url http//www.example.com/xyz/#!/a/b/c in the browser, he...

Can .htaccess rewrites request files outside of the htdocs/httpsdocs area of a server?

On my server, a website resides within a directory similar to /domains/domain.com/public_html. I wish to keep the domain at this path, as all the main files are there, but is there any way to source some files from another location in my server, eg. /global/script.js? In short, I hope to write a mod-rewrite than can source specific file...

.htaccess exclude specific file in webroot from URL rewriting

Hi all, i am running a site with joomla. It has a bunch of mod rewrite rules i don't totally understand.. as well as some kind of SEF link thing running. i have a specific page named sched.html that i need to serve up and be completely ignored from the .htaccess. I have tried everything i can possibly think of. including a number of re...

Rewriting static files in .htaccess

Hello, I have application in subfolder http://example.com/some/other/sub/folder/. And .htaccess file: RewriteEngine on RewriteBase /some/other/sub/folder RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?p=$1 [QSA,L] Template files contain absolute URL to the ...

htaccess redirection for #! in urls

I am using ajax to load pages on my website. Each time a page is loaded I change the url in the browser to http//www.example.com/old/page/#!/new/page/ by setting it through window.loaction using javascript Now what I want to do is when someone comes to my website by entering the url http//www.example.com/old/page/#!/new/page/ he s...

URL rewritten pages force browser to reload page?

We have a server which has ScriptA.php, ScriptB.php and ScriptC.php which all contain text/images that are 80% similar. We're using .htaccess to do url rewriting on ScriptC.php and we're noticing a performance slow down when it loads where it appears that the browser is loading the content afresh every time. When I click on a link to S...

htaccess for static files in subdomain

Hey, I have the following in the htaccess of my main folder Options +FollowSymLinks RewriteEngine on RewriteRule ^css/(.*)\.css$ - [L] RewriteRule ^(.*)\.css$ - [L] The second rule works fine. That is, the CSS files in the main directory are accessed directly. However, this was not propagating to the directory "css". Hence I created...

Throw 404 when requesting file unless HTTPS

I need to create a condition in my .htaccess file that will give a 404 when a user requests a file over HTTP, but not when they request it over HTTPS. I have about 15 files in the same directory that this needs to happen with (but not the others). ...

Recompiling mod_auth_mysql for future modification.

Hey, I'm trying to compile this UNMODIFIED apache mod in ArchLinux so I can modify it later on, but I'm a nub... apxs -c -L/usr/lib/mysql -I/usr/include/mysql -lmysqlclient -lm -lz mod_auth_mysql.c /usr/share/apr-1/build/libtool --silent --mode=compile gcc -prefer-pic -march=x86-64 -mtune=generic -O2 -pipe -DLINU X=2 -D_REENTRANT...

Possible to 301 redirect using apache mod_rewrite to url with scheme that is not "http" and "https"?

Trying to do a 301 redirect using apache mod_rewrite: RewriteRule /the-path/(.*) my-scheme://new-site.com/the-path/$1 [R=301,NC,L] The path http://site.com/the-path/param1=xyz will redirect to http://site.com/my-scheme://new-site.com/the-path/param1-xyz But when I use "http" or "https" in place of "my-scheme" in the rewrite rule, i...