PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > alt.apache.configuration > redirect to a php file from htaccess
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
alt.apache.configuration Apache web server configuration issues.

redirect to a php file from htaccess

Réponse
 
LinkBack Outils de la discussion
Vieux 28/09/2006, 11h11   #1
Leif K-Brooks
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: redirect to a php file from htaccess

Nospam wrote:
> I have a redirect in my htaccess to a php file, however I am trying to see
> if the redirect works from css, by this code
> body{background-image:url(http://www.example.com/redirect1.html); should
> redirect to
>
> (http://www.example.com/redirect1.php); but for some strange reason doesn't
> work in the css, does anyone know what is wrong?


Is http://www.example.com/redirect1.php an image, or is it an HTML page?

If it's an image, it should become the page's background image. If it's
just an HTML page, as I suspect it is, then the browser will try to use
it as a background image but fail.
  Réponse avec citation
Vieux 28/09/2006, 11h16   #2
Nospam
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut redirect to a php file from htaccess

I have a redirect in my htaccess to a php file, however I am trying to see
if the redirect works from css, by this code
body{background-image:url(http://www.example.com/redirect1.html); should
redirect to

(http://www.example.com/redirect1.php); but for some strange reason doesn't
work in the css, does anyone know what is wrong?


  Réponse avec citation
Vieux 28/09/2006, 13h51   #3
Nospam
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: redirect to a php file from htaccess


"Leif K-Brooks" <eurleif@ecritters.biz> wrote in message
news:451b9f7e$0$25777$4d3efbfe@news.sover.net...
> Nospam wrote:
> > I have a redirect in my htaccess to a php file, however I am trying to

see
> > if the redirect works from css, by this code
> > body{background-image:url(http://www.example.com/redirect1.html); should
> > redirect to
> >
> > (http://www.example.com/redirect1.php); but for some strange reason

doesn't
> > work in the css, does anyone know what is wrong?

>
> Is http://www.example.com/redirect1.php an image, or is it an HTML page?
>
> If it's an image, it should become the page's background image. If it's
> just an HTML page, as I suspect it is, then the browser will try to use
> it as a background image but fail.


It is an html page, is there any workaround to redirect to the html page
without the browser failing?


  Réponse avec citation
Vieux 28/09/2006, 14h13   #4
jojo
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: redirect to a php file from htaccess

Nospam wrote:

>>> I have a redirect in my htaccess to a php file, however I am trying to
>>> see if the redirect works from css, by this code
>>> body{background-image:url(http://www.example.com/redirect1.html); should
>>> redirect to (http://www.example.com/redirect1.php); but for some strange
>>> reason doesn't work in the css, does anyone know what is wrong?

>> Is http://www.example.com/redirect1.php an image, or is it an HTML page?
>>
>> If it's an image, it should become the page's background image. If it's
>> just an HTML page, as I suspect it is, then the browser will try to use
>> it as a background image but fail.

>
> It is an html page, is there any workaround to redirect to the html page
> without the browser failing?
>

I'm sorry, but how should this work? a browser cannot display a html
page as background-*image*...
  Réponse avec citation
Vieux 28/09/2006, 14h28   #5
Nospam
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: redirect to a php file from htaccess

I meant is there an alternative way of using the html page as a redirection
apart from using it as a background image?

"jojo" <jojo.hafner@gmx.de> wrote in message
news:efghpq$33g$1@registered.motzarella.org...
> Nospam wrote:
>
> >>> I have a redirect in my htaccess to a php file, however I am trying to
> >>> see if the redirect works from css, by this code
> >>> body{background-image:url(http://www.example.com/redirect1.html);

should
> >>> redirect to (http://www.example.com/redirect1.php); but for some

strange
> >>> reason doesn't work in the css, does anyone know what is wrong?
> >> Is http://www.example.com/redirect1.php an image, or is it an HTML

page?
> >>
> >> If it's an image, it should become the page's background image. If it's
> >> just an HTML page, as I suspect it is, then the browser will try to use
> >> it as a background image but fail.

> >
> > It is an html page, is there any workaround to redirect to the html page
> > without the browser failing?
> >

> I'm sorry, but how should this work? a browser cannot display a html
> page as background-*image*...



  Réponse avec citation
Vieux 28/09/2006, 15h51   #6
jojo
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: redirect to a php file from htaccess

Nospam wrote:
>>>>> I have a redirect in my htaccess to a php file, however I am trying
>>>>> to see if the redirect works from css, by this code
>>>>> body{background-image:url(http://www.example.com/redirect1.html);
>>>>> should redirect to (http://www.example.com/redirect1.php); but for
>>>>> some strange reason doesn't work in the css, does anyone know what
>>>>> is wrong?
>>>>>
>>>> Is http://www.example.com/redirect1.php an image, or is it an HTML
>>>> page?
>>>> If it's an image, it should become the page's background image. If it's
>>>> just an HTML page, as I suspect it is, then the browser will try to use
>>>> it as a background image but fail.
>>> It is an html page, is there any workaround to redirect to the html page
>>> without the browser failing?
>>>

>> I'm sorry, but how should this work? a browser cannot display a html
>> page as background-*image*...
>>

> I meant is there an alternative way of using the html page as a redirection
> apart from using it as a background image?
>

Oh, sorry, I got you wrong than. I guessed that you want to load a
random background-image or something like that using that php script. So
if I got you right you are searching for a way to load a different
document using CSS? or what exactly are you looking for? I do not really
understand what you are planning to do, I'm sorry.
The redirection works, no matter how is called. You can call it via the
browsers address-bar, via any HTML.code, it doesn't matter.
the browser just recognises that something or somebody wants to get the
file and sends the file you redirect to instead of the file which the
browser (or whatever wanted to get the file) wanted to have... quite
simple, I hope my explanation wasn't that complicated..
HTH, jojo

BTW: please make sure that your posting goes *behind* the quote, makes
reading simpler if you can read from the top to the bottom instead of
the way round... thank you!
And please try to configure your OE better, look at the terrible quotes
in your posts... or, would even be better, don't use OE... thanks again ;-)
  Réponse avec citation
Vieux 28/09/2006, 15h57   #7
jojo
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: redirect to a php file from htaccess

Nospam wrote:
>>>>> I have a redirect in my htaccess to a php file, however I am trying
>>>>> to see if the redirect works from css, by this code
>>>>> body{background-image:url(http://www.example.com/redirect1.html);
>>>>> should redirect to (http://www.example.com/redirect1.php); but for
>>>>> some strange reason doesn't work in the css, does anyone know what
>>>>> is wrong?
>>>>>
>>>> Is http://www.example.com/redirect1.php an image, or is it an HTML
>>>> page?
>>>> If it's an image, it should become the page's background image. If it's
>>>> just an HTML page, as I suspect it is, then the browser will try to use
>>>> it as a background image but fail.
>>> It is an html page, is there any workaround to redirect to the html page
>>> without the browser failing?
>>>

>> I'm sorry, but how should this work? a browser cannot display a html
>> page as background-*image*...
>>

> I meant is there an alternative way of using the html page as a redirection
> apart from using it as a background image?
>

Oh, sorry, I got you wrong than. I guessed that you want to load a
random background-image or something like that using that php script. So
if I got you right you are searching for a way to load a different
document using CSS? or what exactly are you looking for? I do not really
understand what you are planning to do, I'm sorry.
The redirection works, no matter how is called. You can call it via the
browsers address-bar, via any HTML.code, it doesn't matter.
the server just recognises that something or somebody wants to get the
file and sends the file you redirect to instead of the file which the
browser (or whatever wanted to get the file) wanted to have... quite
simple, I hope my explanation wasn't that complicated..
HTH, jojo

BTW: please make sure that your posting goes *behind* the quote, makes
reading simpler if you can read from the top to the bottom instead of
the way round... thank you!
And please try to configure your OE better, look at the terrible quotes
in your posts... or, would even be better, don't use OE... thanks again ;-)
  Réponse avec citation
Vieux 28/09/2006, 15h59   #8
jojo
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: redirect to a php file from htaccess

Nospam wrote:
>>>>> I have a redirect in my htaccess to a php file, however I am trying
>>>>> to see if the redirect works from css, by this code
>>>>> body{background-image:url(http://www.example.com/redirect1.html);
>>>>> should redirect to (http://www.example.com/redirect1.php); but for
>>>>> some strange reason doesn't work in the css, does anyone know what
>>>>> is wrong?
>>>>>
>>>> Is http://www.example.com/redirect1.php an image, or is it an HTML
>>>> page?
>>>> If it's an image, it should become the page's background image. If it's
>>>> just an HTML page, as I suspect it is, then the browser will try to use
>>>> it as a background image but fail.
>>> It is an html page, is there any workaround to redirect to the html page
>>> without the browser failing?
>>>

>> I'm sorry, but how should this work? a browser cannot display a html
>> page as background-*image*...
>>

> I meant is there an alternative way of using the html page as a redirection
> apart from using it as a background image?
>

Oh, sorry, I got you wrong than. I guessed that you want to load a
random background-image or something like that using that php script. So
if I got you right you are searching for a way to load a different
document using CSS? or what exactly are you looking for? I do not really
understand what you are planning to do, I'm sorry.
The redirection works, no matter how is called. You can call it via the
browsers address-bar, via any HTML-code, it doesn't matter.
the server just recognises that something or somebody wants to get the
file and sends the file you redirect to instead of the file which the
browser (or whatever wanted to get the file) wanted to have... quite
simple, I hope my explanation wasn't that complicated..
HTH, jojo

BTW: please make sure that your posting goes *behind* the quote, makes
reading simpler if you can read from the top to the bottom instead of
the way round... thank you!
And please try to configure your OE better, look at the terrible quotes
in your posts... or, would even be better, don't use OE... thanks again ;-)
  Réponse avec citation
Vieux 28/09/2006, 17h16   #9
Nospam
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: redirect to a php file from htaccess


"jojo" <jojo.hafner@gmx.de> wrote in message
news:efgo0s$899$3@registered.motzarella.org...
> Nospam wrote:
> >>>>> I have a redirect in my htaccess to a php file, however I am trying
> >>>>> to see if the redirect works from css, by this code
> >>>>> body{background-image:url(http://www.example.com/redirect1.html);
> >>>>> should redirect to (http://www.example.com/redirect1.php); but for
> >>>>> some strange reason doesn't work in the css, does anyone know what
> >>>>> is wrong?
> >>>>>
> >>>> Is http://www.example.com/redirect1.php an image, or is it an HTML
> >>>> page?
> >>>> If it's an image, it should become the page's background image. If

it's
> >>>> just an HTML page, as I suspect it is, then the browser will try to

use
> >>>> it as a background image but fail.
> >>> It is an html page, is there any workaround to redirect to the html

page
> >>> without the browser failing?
> >>>
> >> I'm sorry, but how should this work? a browser cannot display a html
> >> page as background-*image*...
> >>

> > I meant is there an alternative way of using the html page as a

redirection
> > apart from using it as a background image?
> >

> Oh, sorry, I got you wrong than. I guessed that you want to load a
> random background-image or something like that using that php script. So
> if I got you right you are searching for a way to load a different
> document using CSS? or what exactly are you looking for? I do not really
> understand what you are planning to do, I'm sorry.
> The redirection works, no matter how is called. You can call it via the
> browsers address-bar, via any HTML-code, it doesn't matter.
> the server just recognises that something or somebody wants to get the
> file and sends the file you redirect to instead of the file which the
> browser (or whatever wanted to get the file) wanted to have... quite
> simple, I hope my explanation wasn't that complicated..
> HTH, jojo
>
> BTW: please make sure that your posting goes *behind* the quote, makes
> reading simpler if you can read from the top to the bottom instead of
> the way round... thank you!
> And please try to configure your OE better, look at the terrible quotes
> in your posts... or, would even be better, don't use OE... thanks again

;-)

my apologies for top posting. Is there a simple example of redirecting to
the php file using html , css or any other way?


  Réponse avec citation
Vieux 28/09/2006, 18h13   #10
jojo
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: redirect to a php file from htaccess

Nospam wrote:>
>>>>>>> I have a redirect in my htaccess to a php file, however I am trying
>>>>>>> to see if the redirect works from css, by this code
>>>>>>> body{background-image:url(http://www.example.com/redirect1.html);
>>>>>>> should redirect to (http://www.example.com/redirect1.php); but for
>>>>>>> some strange reason doesn't work in the css, does anyone know what
>>>>>>> is wrong?
>>>>>>>
>>>> I'm sorry, but how should this work? a browser cannot display a html
>>>> page as background-*image*...
>>>>
>>> I meant is there an alternative way of using the html page as a
>>> redirection
>>> apart from using it as a background image?
>>>

>> Oh, sorry, I got you wrong than. I guessed that you want to load a
>> random background-image or something like that using that php script. So
>> if I got you right you are searching for a way to load a different
>> document using CSS? or what exactly are you looking for? I do not really
>> understand what you are planning to do, I'm sorry.

<snip>
> Is there a simple example of redirecting to
> the php file using html , css or any other way?
>

why do you need HTML to redirect? use .htaccess:

Redirect permanent /file.html http://www.domain.de/file2.html

or php:

header("Location: http://www.example.com/file2.html");

but it is possible with HTML:

<meta http-equiv="refresh" content="0; URL=file2.html">

But if you can avoid using the "meta-refresh" don't use it. It's some
kind of "dirty" and ASFAIK it does not work with all browsers (but with
the most)

HTH, jojo

  Réponse avec citation
Vieux 28/09/2006, 20h23   #11
Joe Zeff
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: redirect to a php file from htaccess

On Thu, 28 Sep 2006 16:57:06 +0200, jojo <jojo.hafner@gmx.de> wrote:

>BTW: please make sure that your posting goes *behind* the quote, makes
>reading simpler if you can read from the top to the bottom instead of
>the way round... thank you!
>And please try to configure your OE better, look at the terrible quotes
>in your posts... or, would even be better, don't use OE... thanks again ;-)


Yes, top posting is an almost unforgivable sin, but at least it's
worse than double-posting, even when excoriating somebody else for
their sins. <snicker!>

--
Joe Zeff
The Guy With the Sideburns

--
Joe Zeff
The Guy With the Sideburns
Kill as many as you can; I have a morbid love of excess.
http://www.lasfs.info http://zeff.us
http://www.lasfs.info http://zeff.us
  Réponse avec citation
Vieux 28/09/2006, 21h12   #12
Dan
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: redirect to a php file from htaccess


Nospam wrote:
> I meant is there an alternative way of using the html page as a redirection
> apart from using it as a background image?

[top-posting snipped]

Where did you ever get the bizarre idea that using an HTML page
(redirected or not) as a background image would work as a way to
redirect the page? It doesn't.

As for what a *real* way of doing such a redirect would be, how about
maybe redirecting the URL of the *page* itself using .htaccess, rather
than of the background image in the CSS?

--
Dan

  Réponse avec citation
Vieux 29/09/2006, 01h58   #13
Nospam
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: redirect to a php file from htaccess


"Dan" <dan@tobias.name> wrote in message
news:1159474329.942960.304600@m7g2000cwm.googlegro ups.com...
>
> Nospam wrote:
> > I meant is there an alternative way of using the html page as a

redirection
> > apart from using it as a background image?

> [top-posting snipped]
>
> Where did you ever get the bizarre idea that using an HTML page
> (redirected or not) as a background image would work as a way to
> redirect the page? It doesn't.
>
> As for what a *real* way of doing such a redirect would be, how about
> maybe redirecting the URL of the *page* itself using .htaccess, rather
> than of the background image in the CSS?
>
> --
> Dan


My apologies again for the questions, but I what I have is a page linking to
a particular image on a certain page, I would like to redirect the link to
that image without having to redirect the entire html page, just that little
section that is linking to the image to my php file, is this not possible?
maybe not with css but something else?


  Réponse avec citation
Vieux 29/09/2006, 02h06   #14
Luigi Donatello Asero
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: redirect to a php file from htaccess


"Nospam" <nospam@home.com> skrev i meddelandet
news:uc_Sg.42785$8V4.40572@newsfe5-win.ntli.net...
>
> "Dan" <dan@tobias.name> wrote in message
> news:1159474329.942960.304600@m7g2000cwm.googlegro ups.com...
> >
> > Nospam wrote:
> > > I meant is there an alternative way of using the html page as a

> redirection
> > > apart from using it as a background image?

> > [top-posting snipped]
> >
> > Where did you ever get the bizarre idea that using an HTML page
> > (redirected or not) as a background image would work as a way to
> > redirect the page? It doesn't.
> >
> > As for what a *real* way of doing such a redirect would be, how about
> > maybe redirecting the URL of the *page* itself using .htaccess, rather
> > than of the background image in the CSS?
> >
> > --
> > Dan

>
> My apologies again for the questions, but I what I have is a page linking

to
> a particular image on a certain page, I would like to redirect the link to
> that image without having to redirect the entire html page, just that

little
> section that is linking to the image to my php file, is this not possible?
> maybe not with css but something else?


I guess it is
Where is the image?

--
Luigi Donatello Asero
https://www.scaiecat-spa-gigi.com/it/svezia.html
我居ä½åœ¨ç‘žå…¸



  Réponse avec citation
Vieux 29/09/2006, 11h59   #15
Nospam
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: redirect to a php file from htaccess


"Luigi Donatello Asero" <jaggillarfotboll@telia.com> wrote in message
news:_j_Sg.17981$E02.7121@newsb.telia.net...
>
> "Nospam" <nospam@home.com> skrev i meddelandet
> news:uc_Sg.42785$8V4.40572@newsfe5-win.ntli.net...
> >
> > "Dan" <dan@tobias.name> wrote in message
> > news:1159474329.942960.304600@m7g2000cwm.googlegro ups.com...
> > >
> > > Nospam wrote:
> > > > I meant is there an alternative way of using the html page as a

> > redirection
> > > > apart from using it as a background image?
> > > [top-posting snipped]
> > >
> > > Where did you ever get the bizarre idea that using an HTML page
> > > (redirected or not) as a background image would work as a way to
> > > redirect the page? It doesn't.
> > >
> > > As for what a *real* way of doing such a redirect would be, how about
> > > maybe redirecting the URL of the *page* itself using .htaccess, rather
> > > than of the background image in the CSS?
> > >
> > > --
> > > Dan

> >
> > My apologies again for the questions, but I what I have is a page

linking
> to
> > a particular image on a certain page, I would like to redirect the link

to
> > that image without having to redirect the entire html page, just that

> little
> > section that is linking to the image to my php file, is this not

possible?
> > maybe not with css but something else?

>
> I guess it is
> Where is the image?
>
> --
> Luigi Donatello Asero
> https://www.scaiecat-spa-gigi.com/it/svezia.html
> ??????
>
>

The image is on a domain:

http://www.example.com/image1.jpg

and on the html http://www.example.com/redirect.html

I would like to redirect all links to the image (ideally within the window
the image occupies) to my php file which is at
http://www.example.com/redirect.php , still within my
http://www.example.com/redirect.html page. I am unsure which is the best
way to go through this


  Réponse avec citation
Vieux 29/09/2006, 12h14   #16
Dan
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: redirect to a php file from htaccess


Nospam wrote:
> I would like to redirect all links to the image (ideally within the window
> the image occupies) to my php file which is at
> http://www.example.com/redirect.php , still within my
> http://www.example.com/redirect.html page. I am unsure which is the best
> way to go through this


You can redirect an image, but only to another image, not an HTML page.
It would be all right to redirect it to a PHP document, if what the
PHP code does is output an image. Since the place you're referencing
the image is as the background image of a section of an HTML page, the
only thing that's appropriate to use there is another image.

Perhaps what you really are trying to do could be accomplished with a
different method, such as an iframe or a server-side include?

--
Dan

  Réponse avec citation
Vieux 29/09/2006, 17h05   #17
Nospam
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: redirect to a php file from htaccess


"Dan" <dan@tobias.name> wrote in message
news:1159528496.769509.67890@h48g2000cwc.googlegro ups.com...
>
> Nospam wrote:
> > I would like to redirect all links to the image (ideally within the

window
> > the image occupies) to my php file which is at
> > http://www.example.com/redirect.php , still within my
> > http://www.example.com/redirect.html page. I am unsure which is the

best
> > way to go through this

>
> You can redirect an image, but only to another image, not an HTML page.
> It would be all right to redirect it to a PHP document, if what the
> PHP code does is output an image. Since the place you're referencing
> the image is as the background image of a section of an HTML page, the
> only thing that's appropriate to use there is another image.
>
> Perhaps what you really are trying to do could be accomplished with a
> different method, such as an iframe or a server-side include?
>
> --
> Dan
>


Is there an example of how I could do this with an i-frame or server side
include?


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 22h56.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,27924 seconds with 25 queries