Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

udp high ports, d-link extract firmware dsl-2750u, wwwwxxxxx.2G, yxxxcom, WWWXXX, ftp://192.168.100.100, wwwxxx 100, www.xxxcon, wwwxxx, oom killer misbehaves postgresql

Links

XODOX
Impressum

#1: Newbe - mod_rewrite -> redirect to index.php in a subfolder

Posted on 2008-04-20 20:47:01 by Snaggy

here's my problem: I want to have everything redirected to index.php
but for images and javascript. The point is that I'm in a subfolder of
the web server:

http://localhost/mySite/home --> http://localhost/mySite/index.php/home
(rewritten)

http://localhost/mySite/script.js --> http://localhost/mySite/script.js
(not affected)

http://localhost/otherSite/home --> http://localhost/otherSite/home
(not affected)

any help would be appreciated!
thanks
Snaggy

Report this message

#2: Re: Newbe - mod_rewrite -> redirect to index.php in a subfolder

Posted on 2008-04-20 21:12:03 by HansH

"Snaggy" <l.cioria@gmail.com> schreef in bericht
news:d07dda87-608a-4e9d-b7a0-4664566e8342@f63g2000hsf.google groups.com...
> here's my problem: I want to have everything redirected to index.php
> but for images and javascript. The point is that I'm in a subfolder of
> the web server:
>
> http://localhost/mySite/home --> http://localhost/mySite/index.php/home
> (rewritten)
>
> http://localhost/mySite/script.js --> http://localhost/mySite/script.js
> (not affected)
>
> http://localhost/otherSite/home --> http://localhost/otherSite/home
> (not affected)
>
Find below some untested lines to be put in .../mySite/.htaccess
RewriteEngine on
RewriteCond %{REQUEST_URI} ! \.(js|css|[jm]pe?g|gif|png|tiff?|ico)$
RewriteRule (.*) index.php/$1 [L]

Selecting what has to be passed to the script might be more fail safe:
RewriteEngine on
RewriteRule (.*\.(html?|css))$ index.php/$1 [L]

HansH

Report this message

#3: Re: Newbe - mod_rewrite -> redirect to index.php in a subfolder

Posted on 2008-04-22 16:26:30 by drhowarddrfine

>
> Find below some untested lines to be put in .../mySite/.htaccess
> RewriteEngine on
> RewriteCond %{REQUEST_URI} ! \.(js|css|[jm]pe?g|gif|png|tiff?|ico)$
> RewriteRule (.*) index.php/$1 [L]
>
> Selecting what has to be passed to the script might be more fail safe:
> RewriteEngine on
> RewriteRule (.*\.(html?|css))$ index.php/$1 [L]
>
> HansH

I'm trying to do the same thing. I entered that but get a server
error of "bad flag delimiters".

Report this message

#4: Re: Newbe - mod_rewrite -> redirect to index.php in a subfolder

Posted on 2008-04-22 18:48:49 by HansH

"drhowarddrfine" <robbelics@gmail.com> schreef in bericht
news:bd623a2d-e731-4fe8-862d-4c1000cf3549@e67g2000hsa.google groups.com...
>> Find below some untested lines to be put in .../mySite/.htaccess
>> RewriteEngine on
>> RewriteCond %{REQUEST_URI} ! \.(js|css|[jm]pe?g|gif|png|tiff?|ico)$
>> RewriteRule (.*) index.php/$1 [L]
>>
>> Selecting what has to be passed to the script might be more fail safe:
>> RewriteEngine on
>> RewriteRule (.*\.(html?|css))$ index.php/$1 [L]
>>
> I'm trying to do the same thing. I entered that but get a server
> error of "bad flag delimiters".
>
Did you create the file on Windows and uploaded it to *nix?
Than check if line endingsare converted by the FTP tool used.

HansH

Report this message

#5: Re: Newbe - mod_rewrite -> redirect to index.php in a subfolder

Posted on 2008-04-22 18:57:25 by drhowarddrfine

On Apr 22, 11:48 am, "HansH" <ha...@invalid.invalid> wrote:
> "drhowarddrfine" <robbel...@gmail.com> schreef in berichtnews:bd623a2d-e731-4fe8-862d-4c1000cf3549@e67g2000hsa .googlegroups.com...>> Find below some untested lines to be put in .../mySite/.htaccess
> >> RewriteEngine on
> >> RewriteCond %{REQUEST_URI} ! \.(js|css|[jm]pe?g|gif|png|tiff?|ico)$
> >> RewriteRule (.*) index.php/$1 [L]
>
> >> Selecting what has to be passed to the script might be more fail safe:
> >> RewriteEngine on
> >> RewriteRule (.*\.(html?|css))$ index.php/$1 [L]
>
> > I'm trying to do the same thing. I entered that but get a server
> > error of "bad flag delimiters".
>
> Did you create the file on Windows and uploaded it to *nix?
> Than check if line endingsare converted by the FTP tool used.
>
> HansH

No, created on Unix/FreeBSD, then uploaded.

Report this message

#6: Re: Newbe - mod_rewrite -> redirect to index.php in a subfolder

Posted on 2008-04-22 19:24:50 by HansH

"drhowarddrfine" <robbelics@gmail.com> schreef in bericht
news:2b3254ad-fe92-4122-8279-3c68b51915c5@l42g2000hsc.google groups.com...
> On Apr 22, 11:48 am, "HansH" <ha...@invalid.invalid> wrote:
>> "drhowarddrfine" <robbel...@gmail.com> schreef in
>> berichtnews:bd623a2d-e731-4fe8-862d-4c1000cf3549@e67g2000hsa .googlegroups.com...>>
>> Find below some untested lines to be put in .../mySite/.htaccess
>> >> RewriteEngine on
>> >> RewriteCond %{REQUEST_URI} ! \.(js|css|[jm]pe?g|gif|png|tiff?|ico)$
>> >> RewriteRule (.*) index.php/$1 [L]
>>
>> >> Selecting what has to be passed to the script might be more fail safe:
>> >> RewriteEngine on
>> >> RewriteRule (.*\.(html?|css))$ index.php/$1 [L]
>>
>> > I'm trying to do the same thing. I entered that but get a server
>> > error of "bad flag delimiters".
>>
>> Did you create the file on Windows and uploaded it to *nix?
>> Than check if line endingsare converted by the FTP tool used.
>>
> No, created on Unix/FreeBSD, then uploaded.
>
Show a copy of the lines and the complete error logged.

HansH

Report this message

#7: Re: Newbe - mod_rewrite -> redirect to index.php in a subfolder

Posted on 2008-04-22 19:29:59 by Snaggy

using this:

RewriteEngine on
RewriteCond %{REQUEST_URI} !^\.(js|css|[jm]pe?g|gif|png|tiff?|ico)$
RewriteRule (.*) index.php/$1 [L]

I get this error:

"Request exceeded the limit of 10 internal redirects due to probable
configuration error"

it's like it is looping, since the rewritten url is stil passible of
rewriting. How can I tell him not to rewrite it again? Maybe adding as
a condition the absence of "index.php" ?? How to do that?

thanks
Snaggy

Report this message

#8: Re: Newbe - mod_rewrite -> redirect to index.php in a subfolder

Posted on 2008-04-22 21:01:47 by drhowarddrfine

Don't want to hijack Snaggy's thread. I'll start my own.

Report this message

#9: Re: Newbe - mod_rewrite -> redirect to index.php in a subfolder

Posted on 2008-04-22 21:22:54 by HansH

"Snaggy" <l.cioria@gmail.com> schreef in bericht
news:5160588d-81c4-4650-999f-40e86268543b@2g2000hsn.googlegr oups.com...
> RewriteEngine on
> RewriteCond %{REQUEST_URI} !^\.(js|css|[jm]pe?g|gif|png|tiff?|ico)$
> RewriteRule (.*) index.php/$1 [L]
>
> I get this error:
> "Request exceeded the limit of 10 internal redirects due to probable
> configuration error"
>
> it's like it is looping, since the rewritten url is stil passible of
> rewriting. How can I tell him not to rewrite it again? Maybe adding as
> a condition the absence of "index.php" ?? How to do that?
>
Did not expect a loop, since not redirecting, just rewriting ...
.... must be an internal subrequest introduced via .htaccess.

Try
RewriteRule (.*) index.php/$1 [L,NS]

HansH

Report this message