Apache redirect results in endless loop
I want to have requests to http://my.server/directory1/ wind up displaying http://my.server/directory1/test.xsd I tried adding test.xsd to DirectoryIndex in httpd.conf, but that didn't work. I tried adding test.xsd to DirectoryIndex in php.conf but that didn't work, either. I tried a Redirect in httpd.conf that said:
Redirect /directory1 http://my.server/directory1/test.xsd which resulted in a URL of http://my.server/directory1/test.xsd...t.xsd/test.xsd and one in .htaccess in directory1/ that said: Redirect / http://my.server/directory1/test.xsd But that winds up with my browser trying to access http://my.server/directory1/test.xsd...tory1/test.xsd and: Redirect Loop Firefox has detected that the server is redirecting the request for this address in a way that will never complete. What do I need to do to make this work? |
Either percevier with the DocumentIndex angle, or just add an index.html to contain a meta refresh to redirect to it that way.
|
Quote:
You need a redirect rule that matches the exact path; I'd use RedirectMatch, which is similar to Redirect but matches on Regular Expressions: The ? makes the ending / optional (to redirect both /directory1 and /directory1/), and the $ means to match the end of the string. For details on RedirectMatch, see http://httpd.apache.org/docs/1.3/mod...#redirectmatch Hope that helps, —Robert J Lee |
Try this in your .htaccess
AddType text/html .xsd DirectoryIndex file.xsd <Files .htaccess> order allow,deny deny from all </Files> http://httpd.apache.org/docs/2.2/howto/htaccess.html Make sure you have http://httpd.apache.org/docs/2.2/mod...#allowoverride set correctly. (Its probably denied globally (for performance) so you need to allow htaccess files, check your logs for any errors, apache is usually very helpful! |
All times are GMT -5. The time now is 01:17 PM. |