Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > redirect to a php file from htaccess

Reply
Thread Tools

redirect to a php file from htaccess

 
 
Leif K-Brooks
Guest
Posts: n/a
 
      09-28-2006
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.
 
Reply With Quote
 
 
 
 
Nospam
Guest
Posts: n/a
 
      09-28-2006
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?


 
Reply With Quote
 
 
 
 
Nospam
Guest
Posts: n/a
 
      09-28-2006

"Leif K-Brooks" <(E-Mail Removed)> wrote in message
news:451b9f7e$0$25777$(E-Mail Removed)...
> 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?


 
Reply With Quote
 
jojo
Guest
Posts: n/a
 
      09-28-2006
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*...
 
Reply With Quote
 
Nospam
Guest
Posts: n/a
 
      09-28-2006
I meant is there an alternative way of using the html page as a redirection
apart from using it as a background image?

"jojo" <(E-Mail Removed)> wrote in message
news:efghpq$33g$(E-Mail Removed)...
> 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*...



 
Reply With Quote
 
jojo
Guest
Posts: n/a
 
      09-28-2006
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
 
Reply With Quote
 
jojo
Guest
Posts: n/a
 
      09-28-2006
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
 
Reply With Quote
 
jojo
Guest
Posts: n/a
 
      09-28-2006
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
 
Reply With Quote
 
Nospam
Guest
Posts: n/a
 
      09-28-2006

"jojo" <(E-Mail Removed)> wrote in message
news:efgo0s$899$(E-Mail Removed)...
> 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?


 
Reply With Quote
 
jojo
Guest
Posts: n/a
 
      09-28-2006
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Training Institute In Delhi, Live Projects on PHP. Short TermPHP Courses, PHP Scripts, PHP Training with Live Projects. Rajive Narain Java 0 09-18-2009 10:47 AM
.htaccess not getting 404 php pages? Florent HTML 1 02-02-2005 04:57 PM
Re: .htaccess - batch rewrite/ redirect? David Dorward HTML 2 06-29-2003 03:19 PM
Re: .htaccess - batch rewrite/ redirect? brucie HTML 0 06-28-2003 08:23 PM
Re: .htaccess - batch rewrite/ redirect? John Bokma HTML 0 06-28-2003 03:14 PM



Advertisments