.htaccess

URL Rewriting in htaccess

I just rebuilt a site that is currently located at http://domainnamehere.com/v2 The existing site is located at http://domainnamehere.com/ I need to set up a redirect so that when someone goes to the old site, it redirects to the new site. I did this on the htaccess file: Redirect /index.html http://domainnamehere.com/v2/ But this...

URL redirect using .htaccess gives 500 Internal Server Error

Hi, I'm trying to redirect anyone surfing to http://forum.student.khleuven.be to http:// forum.kringraad.be. Both URL's redirect to the same directory, basically. I tried the following using .htaccess: Redirect permanent http://forum.student.khleuven.be/ http://forum.kringraad.be/ and also the following: <IfModule mod_rewrite.c> Rewr...

Need to force http to https and then only force user to login using htaccess and apache

I know how to force http to https, and I know how to use htpasswd to force someone to login to the site. But I need a combination of this. Basically the site needs to be forced to https, and then the authentication needs to happen. Therefore there will be no http access to the site whatsoever. Can anyone supply me with working htaccess ...

Is CakePHP's routing messing up my .htaccess 301 redirect?

I just migrated a site to an updated version, but want to put 301 redirects in place for some of the most common entry pages of the site to their counterparts So here's the rule I'm adding to the .htaccess: Redirect 301 /oldhomepage.htm http://www.thesite.com/ It sort of works, but it redirects to http://www.thesite.com/?url=oldho...

Can an .htaccess file be too large

Our company is changing web platforms and we would like to be able to preserve our Google results so we are planning on putting the 301 redirects into our htaccess file. My concern is that if if I put in all these redirects (probably 3000 - 5000 total) it will slow the server down as it makes all those checks. Does anyone know if havi...

Literals in Mod_rewrite rules

Hi, I have a rule, RewriteRule ^([^/]*)/Strain/([^/]*)/([^/]*)-([^/]*)$ /strain.php?id=$3&strain=$4&source=$2&area=$1 [L] However, having the "Strain" in there doesn't seem to work. What would be the correct syntax for a hard-coded directory name? Thanks :) Any help is much appreciated EDIT: eg,http://mysite.com/San-Diego/Store-Nam...

Apache mod_rewrite redirects, but it's not asked to

I currently have RewriteEngine On RewriteBase / # RewriteRule index\.cgi/(.*) /$1 [R=301,L,NS] RewriteRule . index.cgi [L] I cannot understand why the active rule redirects everything from abc to index.cgi/abc, even though the R directive is not present. This is supposed to produce an internal redirect. ...

1 domain 2 websites

There are 2 different websites in 2 directories ..path/siteA/ and ..path/siteB/ . I need to load one of them on domain example.com depending on their country they are visiting from. It can't be www.example.com/siteA it must be www.example.com . Is it posible? Edit: found the solution. ...

mod_rewrite regexp

I'm working on some rewrite rules, and for some reason a regexp I'm not expecting to pass (and does pass not on any of my regexp testers) is passing in mod_rewrite. The URL in question is: http://url.com/api/projects.json?division=aa And the rewrite rule is: RewriteEngine On RewriteBase / RewriteRule ^api\/([^.?#/%\s]+)\.([^#?\s]+)$...

subdomain htaccess

Hi all, I have here a subdomain which i wish to pass on. here the example of url : http://subdomain.domain.com/login and it should point to : http://subdomain.domain.com/index.php/login i write a simple htaccess RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond $1 !^(index\.php|images|robots\.txt|css|javascript) Rewri...

How to use gzip

Hy can anyone that is using gzip for html js php and css how to implement this on a server. What I want to know is : What do I have do write in .htacces 2.What and from where to download most important does it make a diferance and does it pay off. Thx for your help and time ...

redirection problem with Twitter Library for Codeigniter.

Hi there, I'm using Elliot's Twitter Library for Codeigniter framework (http://www.haughin.com/code/twitter/), the setup went well. But after clicking on allow button on the twitter auth page, it redirected back to the twitter auth page again. I think the problem is with the .htaccess of my server but I cannot get it to work. This is w...

Rewrite url issue

Hi Folks, I'm hoping someone can help me. For my website I have a corresponding mobile site that has the same content as my full site but display it for mobile devices. Basically I want to send all requests from the full site to the mobile site unless the url variable sms exists So in my htaccess file for my full site I have this: R...

HTAccess Rewrite: 301 Redirect Index but not Subdomain

I'm creating an online community and I'm trying to set up a development server. Currently, I'm using GIT as my repository. I have both mysite.com and mysite.net; the .com being the primary site. My Goal: If a user goes to www.mysite.net they should be 301 redirected to www.mysite.com. If a user goes to dev.mysite.net they should b...

Redirecting specific subdomains to domain in IIS6 (ISAPI_Rewrite is installed).

My production web environment contains two clustered servers. I need to redirect any direct requests to the two nodes to the main www URL. I also need to make sure my non-www redirect (with ISAPI_Rewrite) remains in tact. So essentially, I need: domain.com -> www.domain.com node1.domain.com -> www.domain.com node2.domain.com -> www.doma...

trace infinite loop redirection in apache

I have a PHP script causing a infinite redirection loop and i don't know how to detect it. is there any way to detect this? can i add any command to my .htaccess to write redirections into a log? thanks in advance, ...

How to redirects all request to www directory via .htaccess?

Hello, I'm trying to create a .htaccess that would for a subdomain "test" redirects all requests this way: http://test.mydomain.com/something/something2 (1) to http://test.mydomain.com/www/something/something2 (2) so that in browser's address bar is still the address (1)? I have Apache 2.0. I'm trying to writ...

permission for restricted folder with htaccess

Hi, I restricted access to a folder with htaccess, and there is a mp3 file in this folder. When flash mp3 player try to load mp3 in this folder, it cant. is there a way to give permission to flash player ? Thanks ...

ajax suggestion not working with url rewrite? please help

i am not able to fetch xml or any kind of text pulled up with the help of ajax in a search suggestion. I have done url rewrite with mod rewrite. when i remove the url rwrite the code works fine. what may be a problem. RewriteRule ^f/fetchname/(.)/(.)$ http://www.domain.com/fetchname.php?fetchkey=$1&amp;cityidval=$2 [NC] ...

How can I change my multilingual urls from this example.com/index.php?lang=en to this example.com/en/?

Somebody told me that example.com/en is more friendly than example.com/index.php?lang=en. How can I change my URL last part from ?lang=en to /en/? (pd: I don't want to use gettext or any framework like zend to accomplish this) This is how I'm internationalizing and localizing my web page: (live example: alexchen.co.nr/) lang.php: <?...