
![]() |
freedom1972
trying to mimic a deep directory strucutre so I can redirct subdomain.myurl.com/a/b/c/d/e.html to subdomain.myurl.com?index.
php?foo=a&bar=b etc...I was doing some simple testing with apache, but am running into this problemRewriteEngine on RewriteCond ^/(.*)/%{REQUEST_FILENAME} !-f RewriteRule .* /index. php<>RewriteCond ^/%{REQUEST_FILENAME} !-d RewriteRule .* ./index. php<>RewriteEngine Off what I wanted to happen was this: if I requested subdomain.myurl.com/foo/bar.html the first rule will fire, and if I requested subdomain.myurl.com/foo/ the second rule would fire. Instead I get The requested URL /foo/bar.html was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. which to me looks like it is trying to use the error handling in the .htaccess file in the myurl.com as opposed to subdomain.myurl.com. So: 1) is my mod_rewrite syntax correct? 2) do I need to "force" it to use my subdomain .htaccess for error handling over the parent Bompa
/foo/bar.html does not actually exist, correct? This is an example "fake" URL, right?
So, the request is not being matched by either of your directives. If the syntax is not correct you will get Internal Server Error. wish i could say more, but breakfast is being served ![]() Bompa
btw,
REQUEST_FILENAME The full local filesystem path to the file or script matching the request. you sure that's what you want? i usually use REQUEST_URI Bompa
yah, ummm...
this works for me RewriteCond %{REQUEST_URI} (/.*/?) RewriteRule (.*) homepage.cgi <> Then I have my perlscript do:print "REQUEST_URI: $ENV{REQUEST_URI}<br>"; clinically tested. ![]() freedom1972
thanks - I will try the above and see if that gets me what I am going after.
|

Thread Categories

![]() |
![]() |
Best of The Cache Home |
![]() |
![]() |
Search The Cache |
- Ajax
- Apache & mod_rewrite
- BlackHat SEO & Web Stuff
- C/++/#, Pascal etc.
- Database Stuff
- General & Non-Technical Discussion
- General programming, learning to code
- Javascript Discussions & Code
- Linux Related
- Mac, iPhone & OS-X Stuff
- Miscellaneous
- MS Windows Related
- PERL & Python Related
- PHP: Questions & Discussion
- PHP: Techniques, Classes & Examples
- Regular Expressions
- Uncategorized Threads