Re: [PHP] mod_rewrite...https index page -> http index page

2009-12-01 Thread Kim Emax
Hey John

2009/12/1 John Corry 

> My apologies, this is not strictly PHP...but it is relevant to a great
> number of PHP application frameworks that many of us use or will use.
>

Well, still, you should ask in an apache forum :-)

I have a Magento installation that relies heavily on mod_rewrite. For the
> most part, I have all of my canonical URLs worked out, minus one issue.
>
> How do I make sure that https:// requests for / are redirected to http:///
> ?
>

I´ve once solved that by the virtualhost block (http://webmail var directed
to https://webmail)



> I've got a rule already that strips the index.php off of requests, so I
> don't want to check for that...just want to check for requests for the
> https:// version of my root home page and redirect to the non-secure
> version.
>
> I suck with regex and all of my attempts to modify examples I've found have
> failed.
>

well, ^means start of line, but the rewrites I´ve got examples of and are
using at work says ^admin so that´s cleary the query_string, not the entire
URL. (I haven´t used mod_rewite at all until this week...)

And as I see it nothing come close to what you want here:
http://httpd.apache.org/docs/2.0/misc/rewriteguide.html, so maybe it´s not
possible?

or you do this: RewriteRule ^(.*)$  https://yoursite.com$1

This should catch everything in the query_string and save it in $1, maybe
that works?


Kind regards
Kim


[PHP] mod_rewrite...https index page -> http index page

2009-12-01 Thread John Corry
My apologies, this is not strictly PHP...but it is relevant to a great
number of PHP application frameworks that many of us use or will use.

I have a Magento installation that relies heavily on mod_rewrite. For the
most part, I have all of my canonical URLs worked out, minus one issue.

How do I make sure that https:// requests for / are redirected to http:// /
?

I've got a rule already that strips the index.php off of requests, so I
don't want to check for that...just want to check for requests for the
https:// version of my root home page and redirect to the non-secure
version.

I suck with regex and all of my attempts to modify examples I've found have
failed.
-- 
John Corry
PHP developer - 3by400, Inc
http://www.3by400.com


Re: [PHP] mod_rewrite help

2006-05-04 Thread John Nichel

John Wells wrote:

On 5/3/06, Jay Blanchard <[EMAIL PROTECTED]> wrote:

[aha moment]
I finally get it. PHP developers are the smartest people on the planet
and therefore we know and use everything. JavaScript, Java, C++, SQL,
network management, Apache internals, women and even PHP. That is why
people come on this list to ask questions totally unrelated to PHP even
if they try to relate it to PHP by including the URL of a PHP page
within the request.
[/aha moment]


[dream_sequence]
Beautiful Woman:   So how do you use"FFP" to make all of those
pretty-looking website adresses?

Me:   Well actually, *P.H.P.* doesn't do it, but if you're running
your website on Apache, you can use mod_rewrite and some regex pattern
matching to forward your requests onto the appropriate page.  And then
you can parse any number of your server's global variables, like
SCRIPT_URL, to handle the request.

Beautiful Woman:That's hot. Let's make out!
[/dream_sequence]


[gratuitous_back_patting]
This probably is a good opportunity to send out general thanks and
acknowledgement at just how active and *helpful* this list is on a
daily basis (sarcasm included).  In contrast, I just subscribed to the
RubyOnRails list to see what sort of chatter goes on within their
community.  In less than a week the list has already seen well over
300 messages, and the majority of them are never replied to.  Sure,
the RoR world is still in its infancy, but even so.

And at least on our list, if you don't feel like answering a
JavaScript question you don't have to; but on the RoR list you have
little choice, since it's all tied together.

Cheers to the PHP list.  I love it here.
[/gratuitous_back_patting]



Try the qmail list (for a laugh, not for help).

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mod_rewrite help

2006-05-04 Thread John Wells

On 5/3/06, Jay Blanchard <[EMAIL PROTECTED]> wrote:

[aha moment]
I finally get it. PHP developers are the smartest people on the planet
and therefore we know and use everything. JavaScript, Java, C++, SQL,
network management, Apache internals, women and even PHP. That is why
people come on this list to ask questions totally unrelated to PHP even
if they try to relate it to PHP by including the URL of a PHP page
within the request.
[/aha moment]


[dream_sequence]
Beautiful Woman:   So how do you use"FFP" to make all of those
pretty-looking website adresses?

Me:   Well actually, *P.H.P.* doesn't do it, but if you're running
your website on Apache, you can use mod_rewrite and some regex pattern
matching to forward your requests onto the appropriate page.  And then
you can parse any number of your server's global variables, like
SCRIPT_URL, to handle the request.

Beautiful Woman:That's hot. Let's make out!
[/dream_sequence]


[gratuitous_back_patting]
This probably is a good opportunity to send out general thanks and
acknowledgement at just how active and *helpful* this list is on a
daily basis (sarcasm included).  In contrast, I just subscribed to the
RubyOnRails list to see what sort of chatter goes on within their
community.  In less than a week the list has already seen well over
300 messages, and the majority of them are never replied to.  Sure,
the RoR world is still in its infancy, but even so.

And at least on our list, if you don't feel like answering a
JavaScript question you don't have to; but on the RoR list you have
little choice, since it's all tied together.

Cheers to the PHP list.  I love it here.
[/gratuitous_back_patting]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mod_rewrite help

2006-05-03 Thread Stephen Lake
BOL
Now I wish I hadn't slept through Math Class in school

"Jochem Maas" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> John Nichel wrote:
>> Jay Blanchard wrote:
>> 
>>
>
> ...
>
>>
>> How much wood could a woodchuck chuck if a woodchuck could chuck wood?
>>
>> While viewing a php web site that is.
>
> this might help in the calculation:
>
> http://www.netsoc.tcd.ie/~allah/backup/cgi-bin/woodchuck.php
>
> :-) 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mod_rewrite help

2006-05-03 Thread Jochem Maas

John Nichel wrote:

Jay Blanchard wrote:




...



How much wood could a woodchuck chuck if a woodchuck could chuck wood?

While viewing a php web site that is.


this might help in the calculation:

http://www.netsoc.tcd.ie/~allah/backup/cgi-bin/woodchuck.php

:-)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mod_rewrite help

2006-05-03 Thread Jochem Maas

lol - I want a robe too :-) blue will be fine.

Anthony Ettinger wrote:








[aha moment]
I finally get it. PHP developers are the smartest people on the planet
and therefore we know and use everything. JavaScript, Java, C++, SQL,
network management, Apache internals, women and even PHP. That is why
people come on this list to ask questions totally unrelated to PHP even
if they try to relate it to PHP by including the URL of a PHP page
within the request.

Neat.

So I am going to change my attitude. I will answer all questions that I
can, knowing that if I fail someone else on the PHP list will pick up my
slackbecause we know everything and we should share.

I wonder if PHP developers should start wearing special robes or sit on
a designated hilltop somewhere? If we do get robes, can they be blue?
(It'll bring out the color in my eyes and go well with my pickup truck.

Why didn't this occur to me sooner? I could have solved several other
things without sarcasm or reservation. I could have been more
'enlightened'. My journey will have to start now
[/aha moment]



http://www.organicseo.org/URL_Rewriting.html

--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mod_rewrite help

2006-05-03 Thread Jay Blanchard
[snip]
> [snip]
> How much wood could a woodchuck chuck if a woodchuck could chuck wood?
> 
> While viewing a php web site that is.
> [/snip]
> 
> If a woodchuck could chuck wood he (or she) would chuck as much wood
as
> he (or she) could chuck while viewing a php web site.

H, I dunno if it's that simple. I mean... is it a single or
multi-core woodchuck? Does it have hypertransport?
[/snip]

It matters not, Grasshopper. Woodchucks are.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mod_rewrite help

2006-05-03 Thread Robert Cummings
On Wed, 2006-05-03 at 15:36, Jay Blanchard wrote:
> [snip]
> How much wood could a woodchuck chuck if a woodchuck could chuck wood?
> 
> While viewing a php web site that is.
> [/snip]
> 
> If a woodchuck could chuck wood he (or she) would chuck as much wood as
> he (or she) could chuck while viewing a php web site.

H, I dunno if it's that simple. I mean... is it a single or
multi-core woodchuck? Does it have hypertransport?

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mod_rewrite help

2006-05-03 Thread Jay Blanchard
[snip]
How much wood could a woodchuck chuck if a woodchuck could chuck wood?

While viewing a php web site that is.
[/snip]

If a woodchuck could chuck wood he (or she) would chuck as much wood as
he (or she) could chuck while viewing a php web site.

Told you. 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mod_rewrite help

2006-05-03 Thread John Nichel

Jay Blanchard wrote:


[aha moment]
I finally get it. PHP developers are the smartest people on the planet
and therefore we know and use everything. JavaScript, Java, C++, SQL,
network management, Apache internals, women and even PHP. That is why
people come on this list to ask questions totally unrelated to PHP even
if they try to relate it to PHP by including the URL of a PHP page
within the request.

Neat.

So I am going to change my attitude. I will answer all questions that I
can, knowing that if I fail someone else on the PHP list will pick up my
slackbecause we know everything and we should share.

I wonder if PHP developers should start wearing special robes or sit on
a designated hilltop somewhere? If we do get robes, can they be blue?
(It'll bring out the color in my eyes and go well with my pickup truck.

Why didn't this occur to me sooner? I could have solved several other
things without sarcasm or reservation. I could have been more
'enlightened'. My journey will have to start now
[/aha moment]



How much wood could a woodchuck chuck if a woodchuck could chuck wood?

While viewing a php web site that is.

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mod_rewrite help

2006-05-03 Thread Anthony Ettinger

On 5/3/06, Jay Blanchard <[EMAIL PROTECTED]> wrote:

[snip]
I am trying to create a simply rule so that when someone goes to:

mysite.com/users/1

They are redirected to:

mysite.com/users/index.php?uid=1

But am a bit lost looking through all the docs.  I know people do this
all
the time so am looking for some help.
[/snip]

mod_rewrite: A Beginner's Guide to URL Rewriting
http://www.sitepoint.com/article/guide-url-rewriting















































[aha moment]
I finally get it. PHP developers are the smartest people on the planet
and therefore we know and use everything. JavaScript, Java, C++, SQL,
network management, Apache internals, women and even PHP. That is why
people come on this list to ask questions totally unrelated to PHP even
if they try to relate it to PHP by including the URL of a PHP page
within the request.

Neat.

So I am going to change my attitude. I will answer all questions that I
can, knowing that if I fail someone else on the PHP list will pick up my
slackbecause we know everything and we should share.

I wonder if PHP developers should start wearing special robes or sit on
a designated hilltop somewhere? If we do get robes, can they be blue?
(It'll bring out the color in my eyes and go well with my pickup truck.

Why didn't this occur to me sooner? I could have solved several other
things without sarcasm or reservation. I could have been more
'enlightened'. My journey will have to start now
[/aha moment]


http://www.organicseo.org/URL_Rewriting.html

--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mod_rewrite help

2006-05-03 Thread Jay Blanchard
[snip]
I am trying to create a simply rule so that when someone goes to:

mysite.com/users/1

They are redirected to:

mysite.com/users/index.php?uid=1

But am a bit lost looking through all the docs.  I know people do this
all
the time so am looking for some help.
[/snip]

mod_rewrite: A Beginner's Guide to URL Rewriting
http://www.sitepoint.com/article/guide-url-rewriting















































[aha moment]
I finally get it. PHP developers are the smartest people on the planet
and therefore we know and use everything. JavaScript, Java, C++, SQL,
network management, Apache internals, women and even PHP. That is why
people come on this list to ask questions totally unrelated to PHP even
if they try to relate it to PHP by including the URL of a PHP page
within the request.

Neat.

So I am going to change my attitude. I will answer all questions that I
can, knowing that if I fail someone else on the PHP list will pick up my
slackbecause we know everything and we should share.

I wonder if PHP developers should start wearing special robes or sit on
a designated hilltop somewhere? If we do get robes, can they be blue?
(It'll bring out the color in my eyes and go well with my pickup truck.

Why didn't this occur to me sooner? I could have solved several other
things without sarcasm or reservation. I could have been more
'enlightened'. My journey will have to start now
[/aha moment]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mod_rewrite help

2006-05-03 Thread John Nichel

blackwater dev wrote:

Hello all,

I am trying to create a simply rule so that when someone goes to:

mysite.com/users/1

They are redirected to:

mysite.com/users/index.php?uid=1

But am a bit lost looking through all the docs.  I know people do this all
the time so am looking for some help.



http://httpd.apache.org/userslist.html

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mod_rewrite help

2006-05-03 Thread blackwater dev

Hello all,

I am trying to create a simply rule so that when someone goes to:

mysite.com/users/1

They are redirected to:

mysite.com/users/index.php?uid=1

But am a bit lost looking through all the docs.  I know people do this all
the time so am looking for some help.

Thanks!


RE: [PHP] mod_rewrite q's: syntax?

2006-04-10 Thread Micky Hulse
> -Original Message-
> From: Richard Lynch [mailto:[EMAIL PROTECTED] 
> Abandon Outlook and use Eudora, or Pegasus, or webmail, or ANYTHING
> other than Outlook? :-)

LOL! Yeah, I do not know what I was thinking in the first place... Eudora
sounds good to me.  :D

Cheers,
Micky

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mod_rewrite q's: syntax?

2006-04-10 Thread Richard Lynch
On Mon, April 10, 2006 7:08 pm, Micky Hulse wrote:
>> Doing it on only the URLs *you* think of typing doesn't count.
>> Those
>> pesky real users can come up with some really interesting URLs to
>> type... :-)
>
> Lol, I was thinking that might be a problem.
>
> Thanks for all the great tips, I really appreicate your help.
>
> Great info... I am looking forward to learning more about the
> information
> you presented.
>
> Btw, anyone have any good tips for setting-up outlook to format list
> emails
> better? I just got a PC and am coming from the Mac world (Mail app was
> pretty simple compared to all the Microsoft bells and whistles)...

Abandon Outlook and use Eudora, or Pegasus, or webmail, or ANYTHING
other than Outlook? :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mod_rewrite q's: syntax?

2006-04-10 Thread Micky Hulse
Hi Richard,

> Doing it on only the URLs *you* think of typing doesn't count.  Those
> pesky real users can come up with some really interesting URLs to
> type... :-)

Lol, I was thinking that might be a problem.

Thanks for all the great tips, I really appreicate your help.

Great info... I am looking forward to learning more about the information
you presented.

Btw, anyone have any good tips for setting-up outlook to format list emails
better? I just got a PC and am coming from the Mac world (Mail app was
pretty simple compared to all the Microsoft bells and whistles)...

Have a good one,
Cheers,
Micky

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mod_rewrite q's: syntax?

2006-04-10 Thread Micky Hulse
 > -Original Message-
> From: Joe Wollard [mailto:[EMAIL PROTECTED] 
> I'm not an expert on the topic by any stretch of the 
> imagination, but I seem to recall reading that it's best to 
> move everything into httpd.conf for performance reasons. You 
> may want to investigate that, but otherwise I don't see 
> anything wrong with what you're doing.

Sounds good to me, thanks so much for you help. Reading about httpd.conf
now.

Have a great day/week/month/year/...
Cheers,
Micky

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mod_rewrite q's: syntax?

2006-04-10 Thread Richard Lynch
On Mon, April 10, 2006 12:50 am, Micky Hulse wrote:
>> -Original Message-
>> From: Chris [mailto:[EMAIL PROTECTED]
>> Do you need to do it with a mod_rewrite?
>>
>> if not, you can do it easily in php:
>>
>> header('location: folder/file.php');
>> exit();
>>
>> in index.php.
>
>
> Unfortunately, yes... I am using a CMS, and my current setup is
> forcing me
> into using the more complicated mod_rewrite.
>
> Well, not that it is a bad thing... seems like mod_rewrite is more
> search-engine/bot friendly.
>
> Thanks for the tip though, I really appreciate your time.

Another alternative, if mod_rewrite confuses you as much as it does me...

.htaccess

  ForceType application/x-httpd-php

DocumentIndex folder

folder


On the plus side, this doesn't force people into example.com when they
went to www.example.com -- It just works. :-)

PS

I you do stick with mod_rewrite, turn mod_rewrite_debug *ON* and tail
-f your http error_log for awhile.

You'll learn a lot about what will/won't work for mod_rewrite in your
rules...

The warnings about mod_rewrite debugging/logging performance issues
are a bit over-stated, I think...

Or, at least, you need to do this on a development server with "real"
traffic patterns for your testing, if doing it live is a non-option.

Doing it on only the URLs *you* think of typing doesn't count.  Those
pesky real users can come up with some really interesting URLs to
type... :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mod_rewrite q's: syntax?

2006-04-10 Thread Joe Wollard
Mickey,

I'm not an expert on the topic by any stretch of the imagination, but I seem
to recall reading that it's best to move everything into httpd.conf for
performance reasons. You may want to investigate that, but otherwise I don't
see anything wrong with what you're doing.


On 4/10/06, Micky Hulse <[EMAIL PROTECTED]> wrote:
>
> Well, I added this to the end of my .htaccess:
>
> # Set the index page:
> RedirectMatch ^/$ http://mydomain.com/folder/folder/index.php
>
> Seems to work well, but I am still concerned about
> pitfalls/optimization/consolidation... er, perfection? ;)
>
> TIA, Cheers,
> Micky
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


RE: [PHP] mod_rewrite q's: syntax?

2006-04-10 Thread Micky Hulse
Well, I added this to the end of my .htaccess:

# Set the index page:
RedirectMatch ^/$ http://mydomain.com/folder/folder/index.php

Seems to work well, but I am still concerned about
pitfalls/optimization/consolidation... er, perfection? ;)

TIA, Cheers,
Micky

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mod_rewrite q's: syntax?

2006-04-09 Thread Micky Hulse
> -Original Message-
> From: Chris [mailto:[EMAIL PROTECTED] 
> Do you need to do it with a mod_rewrite?
> 
> if not, you can do it easily in php:
> 
> header('location: folder/file.php');
> exit();
> 
> in index.php. 


Unfortunately, yes... I am using a CMS, and my current setup is forcing me
into using the more complicated mod_rewrite.

Well, not that it is a bad thing... seems like mod_rewrite is more
search-engine/bot friendly.

Thanks for the tip though, I really appreciate your time.

Cheers,
Micky

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mod_rewrite q's: syntax?

2006-04-09 Thread Chris

Micky Hulse wrote:

Hi all... sorry if this is OT for PHP list... Maybe a reply off-list?

I just wanted to share my .htaccess file in the hopes that I can
hone/fool-proof-a-tize it as much as possible via your feedback and
suggestions.

Here is what I got so far...

I start by turning-on error reporting, then I am converting all non www
traffic to www traffic, and I finish things up by removing "index.php" from
the site url...

[code] -->

# Turn-on PHP error messaging:
php_value display_errors 1
php_value error_reporting 2047

# Power-up the rewrite engine:
RewriteEngine on

# Redirect all non-www traffic:
RewriteCond %{HTTP_HOST} ^mydomain\.com$
RewriteRule ^.*$ http://www.mydomain.com%{REQUEST_URI} [R=permanent,L]

# Remove index.php from url:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+) index.php/$1 [L]


<-- [/code]

What I want to do:

I would like to use mod_rewrite to forward all requests for
http://www.mydomain.com (or http://mydomain.com) to
www.mydomain.com/folder/file.php

Questions:

1. How is my code looking so far? Any potential pitfalls that you can see?
2. Can I combine the conditions and rules into one, more compact, script?
3. Any suggestions on how I would go about adding-in a rule/condition to
redirect users to "com/folder/file.php" as stated above?


Do you need to do it with a mod_rewrite?

if not, you can do it easily in php:

header('location: folder/file.php');
exit();

in index.php.

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mod_rewrite q's: syntax?

2006-04-09 Thread Micky Hulse
Hi all... sorry if this is OT for PHP list... Maybe a reply off-list?

I just wanted to share my .htaccess file in the hopes that I can
hone/fool-proof-a-tize it as much as possible via your feedback and
suggestions.

Here is what I got so far...

I start by turning-on error reporting, then I am converting all non www
traffic to www traffic, and I finish things up by removing "index.php" from
the site url...

[code] -->

# Turn-on PHP error messaging:
php_value display_errors 1
php_value error_reporting 2047

# Power-up the rewrite engine:
RewriteEngine on

# Redirect all non-www traffic:
RewriteCond %{HTTP_HOST} ^mydomain\.com$
RewriteRule ^.*$ http://www.mydomain.com%{REQUEST_URI} [R=permanent,L]

# Remove index.php from url:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+) index.php/$1 [L]


<-- [/code]

What I want to do:

I would like to use mod_rewrite to forward all requests for
http://www.mydomain.com (or http://mydomain.com) to
www.mydomain.com/folder/file.php

Questions:

1. How is my code looking so far? Any potential pitfalls that you can see?
2. Can I combine the conditions and rules into one, more compact, script?
3. Any suggestions on how I would go about adding-in a rule/condition to
redirect users to "com/folder/file.php" as stated above?

Many TIA,
Sorry if OT.
Cheers,
Micky

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mod_rewrite and include paths

2005-11-21 Thread Marcus Bointon
I found the source of my mod_rewrite problems. I was doing everything  
right to start with - The odd behaviour was due to a PHP bug (http:// 
bugs.php.net/bug.php?id=35059) that's fixed in 4.4.2-dev and 5.1.0RC7- 
dev (I'd assume 5.0.x as well). Recompiling with a new checkout works  
fine.


Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mod_rewrite and include paths

2005-11-14 Thread Marcus Bointon


On 14 Nov 2005, at 18:51, Richard Lynch wrote:


include_path("/full/path/to/DocumentRoot:" . include_path());
This may not be the right syntax/function to set include_path, but it
is a dynamic way to set the include path, from within PHP.


Yup, I tried this and it kind-of works, but still leads to some weird  
behaviour.



INSTEAD, do this.

Create a PHP script, and name it 'x'

In .htaccess, force 'x' to be PHP as far as Apache is concerned:

  ForceType application/x-httpd-php


You can now access your "x=123" from $_SERVER['PATHINFO'] (or is it
'PATH_INFO'?

No more endless tweaking of Regex rules in httpd.conf and logging the
mod_rewrite and dinking with ^/[0-9]+ junk and re-starting Apache
every time you want to try a change.


That's a nice trick - I'll have to remember that. My rules are  
in .htaccess (as seems normal for 'deployable' systems) so I don't  
need to restart apache and it's easy to twiddle with them, and  
besides, I like regexes ;^) The issue isn't really the passing of  
parameters (which your approach deals with very nicely), it's that  
PHP gets fooled into thinking that it's somewhere that it's not. The  
most annoying thing about this problem is that I'm sure it should  
'just work', and I know I've seen it do so before in both my scripts  
and others - Serendipity has an almost identical setup for rewrites  
and it doesn't do anything special to work with them - all this  
futzing with paths that mod_rewrite does is long finished by the time  
that PHP gets to hear about anything - PHP never has to know the real  
URL, it should be happy to deal with the rewritten one.


The problem seems to be that given the incoming URL:

/x/123

this gets rewritten to

/x.php?x=123

and it does run the correct script in the correct directory, however,  
once it's running PHP acts as if it had said:


/x/x.php?x=123

Which just breaks paths everywhere. I know that this is what the  
passthrough option is supposed to deal with, but removing it doesn't  
help either. Maybe I should look more carefully at my RewriteBase etc.


I've asked in sitepoint apache forums too, see if anyone there has  
any idea.


Thanks for the ideas.

Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mod_rewrite and include paths

2005-11-14 Thread Richard Lynch
On Sun, November 13, 2005 4:05 pm, Marcus Bointon wrote:
> This seems like a simple problem...

Maybe there should be a simple solution... :-)

> I have a rewrite like this:
>
> RewriteRule ^x/([0-9]+) x.php?x=$1 [PT,L]
>
> This maps a url like http://www.example.com/x/123 to http://
> www.example.com/x.php?x=123
>
> x.php contains a line to include some class like:
>
> require_once 'x.class.php';
>
> My include path contains '.' (plus paths to pear, etc), and the class
> file is in the top level directory.

If it's in the top level directory, then maybe that directory should
be hard-coded into the include_path, as well as '.'

include_path
".:/whatever/httpd.conf/has/for/DocumentRoot:/full/path/to/PEAR"

> So how can I get PHP to look in /? I can set include_path with a
> php_value in .htaccess, but I can only set it absolutely (losing
> existing values), not add to it (AFAIK?). I don't want to add an
> absolute path to my global include_path as there may be multiple
> independent deployments of the same scripts on the server, and I
> don't want them including each others files. Adding .. to the path
> would work but is a security risk. Any other ideas?

This all rules out the above, but one possibility is this:

In just the script that gives you trouble do this:

include_path("/full/path/to/DocumentRoot:" . include_path());
This may not be the right syntax/function to set include_path, but it
is a dynamic way to set the include path, from within PHP.

Of course, for the multiple deployments, you'll need to make the path
based on the deployment somehow.


Now, on to the simple solution I intimated at the beginning...

If mod_rewrite is giving you the headaches it gives me, just get rid
of it. :-)

INSTEAD, do this.

Create a PHP script, and name it 'x'

In .htaccess, force 'x' to be PHP as far as Apache is concerned:

  ForceType application/x-httpd-php


You can now access your "x=123" from $_SERVER['PATHINFO'] (or is it
'PATH_INFO'?

No more endless tweaking of Regex rules in httpd.conf and logging the
mod_rewrite and dinking with ^/[0-9]+ junk and re-starting Apache
every time you want to try a change.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mod_rewrite and include paths

2005-11-13 Thread Marcus Bointon

On 13 Nov 2005, at 22:15, Marco Kaiser wrote:

try to use realpath, dirname and other related funktion to resolv  
the real path.


dirname(__FILE__) ?


Good point (you can tell I've been up too long). I've just had a play  
with that - I appended the current path to my include_path, but it  
seems it's not inherited, so sub-includes are not found. I also tried  
chdir(dirname(__FILE__)) which had the same results and interferes  
with the operation of require_once (the same file found by a  
different path doesn't get counted as the same file). Incidentally  
doing just 'echo getcwd();' seems to fail completely when called via  
a rewrite. After all that, smarty still can't find its templates_c  
for some reason. I'm sure there must be something simple and elegant  
I'm missing. Probably a good night's sleep.


Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mod_rewrite and include paths

2005-11-13 Thread Marco Kaiser
Hi Marcus,

try to use realpath, dirname and other related funktion to resolv the real path.

dirname(__FILE__) ?

-- Marco

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mod_rewrite and include paths

2005-11-13 Thread Marcus Bointon

This seems like a simple problem...

I have a rewrite like this:

RewriteRule ^x/([0-9]+) x.php?x=$1 [PT,L]

This maps a url like http://www.example.com/x/123 to http:// 
www.example.com/x.php?x=123


x.php contains a line to include some class like:

require_once 'x.class.php';

My include path contains '.' (plus paths to pear, etc), and the class  
file is in the top level directory.


This configuration will fail with a file not found error. Because of  
the rewrite, PHP ends up looking for x/x.class.php instead of just  
x.class.php. If I change the PT option to R (AKA ugly mode), it works  
fine as PHP gets to know about the real URL.


So how can I get PHP to look in /? I can set include_path with a  
php_value in .htaccess, but I can only set it absolutely (losing  
existing values), not add to it (AFAIK?). I don't want to add an  
absolute path to my global include_path as there may be multiple  
independent deployments of the same scripts on the server, and I  
don't want them including each others files. Adding .. to the path  
would work but is a security risk. Any other ideas?


Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mod_rewrite, apache2, php5RC1 and osx bsd

2005-11-11 Thread Marcus Bointon

On 10 Nov 2005, at 21:36, Richard Lynch wrote:


On Wed, November 9, 2005 10:36 pm, Dan Rossi wrote:

RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/(.+\.(video))$
../../phpscript.php


I should think all those .* should be .+ instead...

I mean, if somebody surfs to this URL:

http://example.com//example.video


There's nothing really wrong with a URL like that, and I used to do  
the same thing until I discovered another fly in this particular  
ointment. Should source URLs like these ever appear in Microsoft  
Outlook, they are likely to get 'corrected', for example a URL that  
goes in as:


http://example.com//example.video

When you click it, you're quite likely to have it go to:

http://example.com/example.video

thus completely missing all your mod_rewrite patterns. This is why we  
love MS so. I've taken up using _ as a pattern separator as a  
workaround.


There's also a very nasty bug in current mod_rewrite (at least in  
Apache 2.0.54) where mod_rewrite url decodes submatches between input  
and output URLs, so for example:


RewriteRule ^(.*) blah.php?x$1

if you feed that a URL that contains a URL encoded value like 'Hello% 
20there', your resulting URL will be: 'blah.php?x=Hello there', which  
is obviously broken.


Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mod_rewrite, apache2, php5RC1 and osx bsd

2005-11-10 Thread Curt Zirzow
On Fri, Nov 11, 2005 at 01:27:32PM +1100, Dan Rossi wrote:
> 
> On 11/11/2005, at 1:21 PM, Curt Zirzow wrote:
> 
> >>
> >
> >Of course i dont get what your trying to do, the rewriterule
> >doesn't match your description of what you said.
> 
> Ok i am vague at most times, i wasnt going to give an exact example as  
> it will give away some of the systems secret and not so good when it  
> goes into the archive :\

Could you come up with a simplified example that causes the error,
so it could be tested on other systems. I was able to have
something like:

 RewriteRule ^(.*)/(.*)/$ /index.php?f=$1&b=$2 [L]

And accessing /foo/bar/ It worked like a charm with: 
   $_GET['f'] == '/foo' and $_GET['b'] == 'bar'

When I used the ../../index.php it would cause a 400 Bad Request,
i'm not clear on how your are doing your relative paths.

> >Also You mention fink but then you mention bsd, does  it happen on
> >both systems?
> 
> Errm live system is running php 4.4.1 / Apache 1.3  and its ok. Im  
> looking at upgrading it to php 5.1 when its out.

yeah, this makes me wonder if there are issues with the fink binary
you are using. Is the web server going to get upgraded to 2.x as
well?  I know that php has a completely different way to talk with
the 1.x vs 2.x which can complicate the issue a bit.

> >The hanging could be a loop of some sort, have you looked at the
> >output of the rewrite log to see exactly what is going on?
> 
> Where can i find the log for that, i get a heap  of errors like this  
> though

You can set:
  RewriteLog /path/to/writable/file
  RewriteLogLevel 9 #where 9 is the most verbose

> 
> [Thu Nov 10 15:26:06 2005] [error] Optional hook test said: GET  
> /videos/dir/42288faa3649e8a66b28871ba9d7e77b/457867517/ 
> 713ced53f69d16f48072c2d13705e91b/95/180/video.stream HTTP/1.0

I'm not really sure what this means, it is related to the
./configure options for apache  --enable-optional-hook*, i have no
clue what that does.


Curt.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mod_rewrite, apache2, php5RC1 and osx bsd

2005-11-10 Thread Dan Rossi


On 11/11/2005, at 1:21 PM, Curt Zirzow wrote:





Of course i dont get what your trying to do, the rewriterule
doesn't match your description of what you said.


Ok i am vague at most times, i wasnt going to give an exact example as  
it will give away some of the systems secret and not so good when it  
goes into the archive :\







From your other discusions it is kind of unclear exactly what

version of apache you are using, as well as are you using perfork,
perchild, worker, etc..



Its a prefork setup, worker would be nice though :D



Also You mention fink but then you mention bsd, does  it happen on
both systems?


Errm live system is running php 4.4.1 / Apache 1.3  and its ok. Im  
looking at upgrading it to php 5.1 when its out.




As far it trying to download the faked url, what exactly is it
trying to download and what are the headers for the request as
well.

The hanging could be a loop of some sort, have you looked at the
output of the rewrite log to see exactly what is going on?




Where can i find the log for that, i get a heap  of errors like this  
though


[Thu Nov 10 15:26:06 2005] [error] Optional hook test said: GET  
/videos/dir/42288faa3649e8a66b28871ba9d7e77b/457867517/ 
713ced53f69d16f48072c2d13705e91b/95/180/video.stream HTTP/1.0


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mod_rewrite, apache2, php5RC1 and osx bsd

2005-11-10 Thread Curt Zirzow
On Thu, Nov 10, 2005 at 06:10:50PM +1100, Dan Rossi wrote:
> 
> On 10/11/2005, at 4:18 PM, Curt Zirzow wrote:
> 
> >On Thu, Nov 10, 2005 at 03:36:07PM +1100, Dan Rossi wrote:
> >>Hi there, ive been having issues with mod_rewrite and apache2 with PHP
> >>5.1RC1. I have googled the php bugs and people have been experiencing
> >>the same issue however the php people cant see to reproduce the bug.
> >>Its most definately doing it for me, here is a rewrite rule i have
> >>setup, if i [L] to a php script, it either tries to download the faked
> >>url file or hangs.  I reverted back to 5.1.0b2 and it works fine ??
> >>What do i do ?
> >>
> >>RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/(.+\.(video))$ 
> >>../../phpscript.php
> >
> >Well this is a really ugly Rewrite, i must say.
> 
> Say what you like however it had been working, and for the application 
> it works, i dont think you get what its trying to do but anyway , im 
> faking a url with session id's and ecrypted keys and sending the 
> matches to the get request of that file so its hidden.

Of course i dont get what your trying to do, the rewriterule
doesn't match your description of what you said.

> 
> >
> >One thing to note is well 5.1RC4 has been available in Oct:
> >  http://downloads.php.net/ilia/
> >
> 
> Thats not available from the main site downloads. I also forgot to 
> meantion i had downloaded the latest from php snaps and still the same 
> problem, so obviouslly it has been overlooked.
 
>From your other discusions it is kind of unclear exactly what
version of apache you are using, as well as are you using perfork,
perchild, worker, etc..

Also You mention fink but then you mention bsd, does  it happen on
both systems?

As far it trying to download the faked url, what exactly is it
trying to download and what are the headers for the request as
well.

The hanging could be a loop of some sort, have you looked at the
output of the rewrite log to see exactly what is going on?

 
Curt
-- 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mod_rewrite, apache2, php5RC1 and osx bsd

2005-11-10 Thread Dan Rossi


On 11/11/2005, at 8:53 AM, Max Belushkin wrote:

I've been having a problem with PHP 4.4.1 and mod_rewrite, which, as  
Geert

Booster kindly pointed out, has been reported on
http://lists.freebsd.org/pipermail/freebsd-ports/2005-November/ 
027038.html,
which also has a link to the PHP bug report in the thread. Not sure if  
this

is relevant to PHP5, but thought I'd mention that something similar
exist(ed?) in the 4.4.1 version.



There is also a bug report which is now closed for my problem !! This  
bug still exists in the latest PHP 5.1 in snaps.php.net. Mind you my  
apache is a fink binary, not bsd ports. There is huge issues compiling  
apache under osx bsd, hence why i had to go with the binary. Mind you  
osx is my dev environment coz its also my laptop,it is not production  
lol, our production machine however is also BSD. To prove it wasnt thee  
rewrite rule, i made it [L] to a standard html file and it was fine, so  
there is something up with it in php obviouslly in the module.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mod_rewrite, apache2, php5RC1 and osx bsd

2005-11-10 Thread Dan Rossi


On 11/11/2005, at 8:36 AM, Richard Lynch wrote:


On Wed, November 9, 2005 10:36 pm, Dan Rossi wrote:

Hi there, ive been having issues with mod_rewrite and apache2 with PHP
5.1RC1. I have googled the php bugs and people have been experiencing
the same issue however the php people cant see to reproduce the bug.
Its most definately doing it for me, here is a rewrite rule i have
setup, if i [L] to a php script, it either tries to download the faked
url file or hangs.  I reverted back to 5.1.0b2 and it works fine ??
What do i do ?

RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/(.+\.(video))$
../../phpscript.php


I should think all those .* should be .+ instead...


Ill try that thanks ! I guess i could also use [A-z] or whatever lol



I mean, if somebody surfs to this URL:

http://example.com//example.video

Do you really want that to hit ../../phpscript.php


No not at all, this file is actually called from a windows media player 
embedded plugin , ie 
/videos/somethingtoaddtogetquery/anotherthingtoaddtogetquery passed to 
the script as ?somequery=$1&anotherquery=$2


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mod_rewrite, apache2, php5RC1 and osx bsd

2005-11-10 Thread Max Belushkin
I've been having a problem with PHP 4.4.1 and mod_rewrite, which, as Geert 
Booster kindly pointed out, has been reported on 
http://lists.freebsd.org/pipermail/freebsd-ports/2005-November/027038.html, 
which also has a link to the PHP bug report in the thread. Not sure if this 
is relevant to PHP5, but thought I'd mention that something similar 
exist(ed?) in the 4.4.1 version.

On Thursday 10 November 2005 22:36, Richard Lynch wrote:
> On Wed, November 9, 2005 10:36 pm, Dan Rossi wrote:
> > Hi there, ive been having issues with mod_rewrite and apache2 with PHP
> > 5.1RC1. I have googled the php bugs and people have been experiencing
> > the same issue however the php people cant see to reproduce the bug.
> > Its most definately doing it for me, here is a rewrite rule i have
> > setup, if i [L] to a php script, it either tries to download the faked
> > url file or hangs.  I reverted back to 5.1.0b2 and it works fine ??
> > What do i do ?
> >
> > RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/(.+\.(video))$
> > ../../phpscript.php
>
> I should think all those .* should be .+ instead...
>
> I mean, if somebody surfs to this URL:
>
> http://example.com//example.video
>
> Do you really want that to hit ../../phpscript.php
>
> This probably will not fix your bug, mind you, but it's probably worth
> trying just to see.
>
> I think you could also lose all those ()s in the Regex, as you don't
> seem to be doing anything with them.  Or perhaps mod_rewrite collects
> them and passes them in to phpscript.php somehow?
>
> You could also consider using:
> [^/]* instead of . because, after all, .* does match /, so maybe you
> are confusing the Regex so that:
> //example.video actually matches your pattern, even though you
> really don't want it to.
>
> I haven't used mod_rewrite enough to know what pattern system it uses,
> so I could be full of [bleep] here.
>
> If all else fails, consider not using mod_rewrite at all, and having a
> ForceType on some convenient directory to change that directory into a
> PHP script.
>
> For example, suppose you now have:
> ~/videos/*.video
> with a zillion video files in there for the *
>
> mkdir video_files
> mv videos/*.video video_files
> rmdir videos
> cp phpscript.php videos
> echo -e "\nForceType application/x-httpd-php\n"
>
> > .htaccess
>
> Now, your "videos" directory is *REALLY* your phpscript.php, but it
> just *looks* like a directory in the URL.
>
> You'd need to change phpscript.php to read the videos (or whatever it
> does to them) from "/video_files/" instead of where they are now.
>
> --
> Like Music?
> http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mod_rewrite, apache2, php5RC1 and osx bsd

2005-11-10 Thread Richard Lynch
On Wed, November 9, 2005 10:36 pm, Dan Rossi wrote:
> Hi there, ive been having issues with mod_rewrite and apache2 with PHP
> 5.1RC1. I have googled the php bugs and people have been experiencing
> the same issue however the php people cant see to reproduce the bug.
> Its most definately doing it for me, here is a rewrite rule i have
> setup, if i [L] to a php script, it either tries to download the faked
> url file or hangs.  I reverted back to 5.1.0b2 and it works fine ??
> What do i do ?
>
> RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/(.+\.(video))$
> ../../phpscript.php

I should think all those .* should be .+ instead...

I mean, if somebody surfs to this URL:

http://example.com//example.video

Do you really want that to hit ../../phpscript.php

This probably will not fix your bug, mind you, but it's probably worth
trying just to see.

I think you could also lose all those ()s in the Regex, as you don't
seem to be doing anything with them.  Or perhaps mod_rewrite collects
them and passes them in to phpscript.php somehow?

You could also consider using:
[^/]* instead of . because, after all, .* does match /, so maybe you
are confusing the Regex so that:
//example.video actually matches your pattern, even though you
really don't want it to.

I haven't used mod_rewrite enough to know what pattern system it uses,
so I could be full of [bleep] here.

If all else fails, consider not using mod_rewrite at all, and having a
ForceType on some convenient directory to change that directory into a
PHP script.

For example, suppose you now have:
~/videos/*.video
with a zillion video files in there for the *

mkdir video_files
mv videos/*.video video_files
rmdir videos
cp phpscript.php videos
echo -e "\nForceType application/x-httpd-php\n"
> .htaccess

Now, your "videos" directory is *REALLY* your phpscript.php, but it
just *looks* like a directory in the URL.

You'd need to change phpscript.php to read the videos (or whatever it
does to them) from "/video_files/" instead of where they are now.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mod_rewrite, apache2, php5RC1 and osx bsd

2005-11-09 Thread Dan Rossi


On 10/11/2005, at 4:18 PM, Curt Zirzow wrote:


On Thu, Nov 10, 2005 at 03:36:07PM +1100, Dan Rossi wrote:

Hi there, ive been having issues with mod_rewrite and apache2 with PHP
5.1RC1. I have googled the php bugs and people have been experiencing
the same issue however the php people cant see to reproduce the bug.
Its most definately doing it for me, here is a rewrite rule i have
setup, if i [L] to a php script, it either tries to download the faked
url file or hangs.  I reverted back to 5.1.0b2 and it works fine ??
What do i do ?

RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/(.+\.(video))$ 
../../phpscript.php


Well this is a really ugly Rewrite, i must say.


Say what you like however it had been working, and for the application 
it works, i dont think you get what its trying to do but anyway , im 
faking a url with session id's and ecrypted keys and sending the 
matches to the get request of that file so its hidden.




One thing to note is well 5.1RC4 has been available in Oct:
  http://downloads.php.net/ilia/




Thats not available from the main site downloads. I also forgot to 
meantion i had downloaded the latest from php snaps and still the same 
problem, so obviouslly it has been overlooked.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mod_rewrite, apache2, php5RC1 and osx bsd

2005-11-09 Thread Curt Zirzow
On Thu, Nov 10, 2005 at 03:36:07PM +1100, Dan Rossi wrote:
> Hi there, ive been having issues with mod_rewrite and apache2 with PHP 
> 5.1RC1. I have googled the php bugs and people have been experiencing 
> the same issue however the php people cant see to reproduce the bug. 
> Its most definately doing it for me, here is a rewrite rule i have 
> setup, if i [L] to a php script, it either tries to download the faked 
> url file or hangs.  I reverted back to 5.1.0b2 and it works fine ?? 
> What do i do ?
> 
> RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/(.+\.(video))$ ../../phpscript.php

Well this is a really ugly Rewrite, i must say.

One thing to note is well 5.1RC4 has been available in Oct:
  http://downloads.php.net/ilia/

Curt.
-- 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mod_rewrite, apache2, php5RC1 and osx bsd

2005-11-09 Thread Dan Rossi
Hi there, ive been having issues with mod_rewrite and apache2 with PHP 
5.1RC1. I have googled the php bugs and people have been experiencing 
the same issue however the php people cant see to reproduce the bug. 
Its most definately doing it for me, here is a rewrite rule i have 
setup, if i [L] to a php script, it either tries to download the faked 
url file or hangs.  I reverted back to 5.1.0b2 and it works fine ?? 
What do i do ?


RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/(.+\.(video))$ ../../phpscript.php

RE: [PHP] mod_rewrite and getting url variables

2005-04-12 Thread Chris W. Parker
Matthew Weier O'Phinney 
on Tuesday, April 12, 2005 9:42 AM said:

> When using mod_rewrite, if the rewrite rule does not include a
> pass-through, then the query string is not passed on to the script in
> question. So, if you request the page directly with:
> 
> http://www.mysite.com/page.php?id=1
> 
> it will process correctly, but if you have a rewrite rule that doesn't
> have the pass-through flag, then when the URL is _rewritten_ to the
> above, the page is requested _without_ the query string -- even
> though the rule rewrites the URL with a query string.

Hmm.. I guess I'll have to try it out to understand what's going on.
I've never run across the problem myself.


Thanks,
Chris.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mod_rewrite from .htaccess

2005-04-12 Thread Greg Donald
On 4/12/05, Amir Mohammad Saied <[EMAIL PROTECTED]> wrote:
> I want to use mod_rewrite patterns, but i have not access to the
> httpd.conf so i think i should use .htaccess, but the patterns don't
> work properly there, have my admin should set any settings in the
> httpd.conf?

AllowOverrides must be On for .htaccess files to work.


-- 
Greg Donald
Zend Certified Engineer
http://destiney.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mod_rewrite and getting url variables

2005-04-12 Thread Matthew Weier O'Phinney
* Chris W. Parker <[EMAIL PROTECTED]>:
> Ospinto 
> on Tuesday, April 12, 2005 10:32 AM said:
>
>> I used mod_rewrite to change http://www.mysite.com/page/1 to
>> http://www.mysite.com/page.php?id=1 to enable a search friendly url.
>
> Ok I'm with you.
>
>> Everything works fine, except that when I try to get the URL variable
>> ($id) by using $_GET, it doesn't return anything. With
>> http://www.mysite.com/page.php?id=1 it gets $id just fine.
>
> Now you've lost me. Those two statements seem to be in opposition to one
> another. You can't get $id with $_GET but
> http://www.mysite.com/page.php?id=1 works just fine? The URL is a "GET"
> URL since it has a querystring.

When using mod_rewrite, if the rewrite rule does not include a
pass-through, then the query string is not passed on to the script in
question. So, if you request the page directly with:

http://www.mysite.com/page.php?id=1

it will process correctly, but if you have a rewrite rule that doesn't
have the pass-through flag, then when the URL is _rewritten_ to the above,
the page is requested _without_ the query string -- even though the rule
rewrites the URL with a query string.

A rule that would (probably) work would look something like this:

RewriteRule page/(.*) /page.php?id=$1 [L,PT]

-- 
Matthew Weier O'Phinney   | WEBSITES:
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org
mailto:[EMAIL PROTECTED] | http://vermontbotanical.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mod_rewrite from .htaccess

2005-04-12 Thread Amir Mohammad Saied
I want to use mod_rewrite patterns, but i have not access to the 
httpd.conf so i think i should use .htaccess, but the patterns don't 
work properly there, have my admin should set any settings in the 
httpd.conf?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] mod_rewrite and getting url variables

2005-04-12 Thread Chris W. Parker
Ospinto 
on Tuesday, April 12, 2005 10:32 AM said:

> I used mod_rewrite to change http://www.mysite.com/page/1 to
> http://www.mysite.com/page.php?id=1 to enable a search friendly url.

Ok I'm with you.

> Everything works fine, except that when I try to get the URL variable
> ($id) by using $_GET, it doesn't return anything. With
> http://www.mysite.com/page.php?id=1 it gets $id just fine.

Now you've lost me. Those two statements seem to be in opposition to one
another. You can't get $id with $_GET but
http://www.mysite.com/page.php?id=1 works just fine? The URL is a "GET"
URL since it has a querystring.



Chris.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mod_rewrite and getting url variables

2005-04-12 Thread Ospinto
I used mod_rewrite to change http://www.mysite.com/page/1 to
http://www.mysite.com/page.php?id=1 to enable a search friendly url.
Everything works fine, except that when I try to get the URL variable ($id)
by using $_GET, it doesn't return anything. With
http://www.mysite.com/page.php?id=1 it gets $id just fine. I thought the
mod_rewrite would keep the url variables??? If not, I know the alternative
would be to get the whole url as a string and change it to an array by using
the "/" as the delimiter and obtain $id from that. But I'd rather go that
way if there's no other alternative.
The .htaccess file has the following commands:

RewriteEngine On
RewriteRule ^page/([0-9]+)/?$ page.php?id=$1 [L]

Any help would be greatly appreciated.
Thanks.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mod_rewrite

2004-07-01 Thread David Bevan
Hi Pete,

Check out the documentation on the Apache site:
http://httpd.apache.org/docs-2.1/mod/mod_rewrite.html

They also have a URL Rewriting Guide:
http://httpd.apache.org/docs-2.1/misc/rewriteguide.html

Hope this helps.

Regards,

David

 


-Original Message-
From: pete M [mailto:[EMAIL PROTECTED] 
Sent: July 1, 2004 9:14 AM
To: [EMAIL PROTECTED]
Subject: [PHP] mod_rewrite


Know this is off topic bu can anyone help with a tuotial of something - 
been looking everywhere

All I want is a rule to  rewrite
www.example.com?page=mypage&id=20&this=that  to 
www.example.com/mypage/20/this

tia
Pete

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mod_rewrite[Scanned]

2004-07-01 Thread Michael Egan
Pete,

There was a thread some time ago on the issue of cloaking URLs in which a couple of 
contributors pointed to tutorials on the following site:

http://www.alistapart.com/articles/urls/

HTH,

Michael Egan

-Original Message-
From: pete M [mailto:[EMAIL PROTECTED]
Sent: 01 July 2004 14:14
To: [EMAIL PROTECTED]
Subject: [PHP] mod_rewrite[Scanned]


Know this is off topic bu can anyone help with a tuotial of something - 
been looking everywhere

All I want is a rule to  rewrite
www.example.com?page=mypage&id=20&this=that  to 
www.example.com/mypage/20/this

tia
Pete

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php 
The information contained in this email (and in any attachments sent with it) is 
confidential. It is intended for the addressee only. Access to this email by anyone 
else is unintended and unauthorized.  
If you are not the original addressee, 3tc asks you to please maintain 
confidentiality. If you have received this email in error please notify 3tc 
immediately by replying to it, then destroy any copies and delete it from your 
computer system. 
Any use, dissemination, forwarding, printing or copying of this email by anyone except 
the addressee in the normal course of his/her business, is strictly prohibited. 3tc 
owns the copyright in this email and any document created by us and assert the right 
to be identified as the author of it. Copyright has not been transferred to the 
addressee. 
We protect our systems with Sophos Anti-virus -  
www.sophos.com 
 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mod_rewrite

2004-07-01 Thread pete M
Know this is off topic bu can anyone help with a tuotial of something - 
been looking everywhere

All I want is a rule to  rewrite
www.example.com?page=mypage&id=20&this=that  to 
www.example.com/mypage/20/this

tia
Pete
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] mod_rewrite Issues

2004-06-19 Thread Michal Migurski
> This isn't exactly a PHP issue, but they seem to go rather hand in
> hand...
>
> Right now I'm just running my own apache server on my computer and I'm
> trying to protect my scripts using mod_rewrite. I uncommented all the
> mod_rewrite lines in the apache configuration file and restarted it all. I
> got no errors doing this, so I assume it compiled fine.
>
> The problem is, I can put a rewrite rule in the httpd.conf file or a
> .htaccess file but it never rewrites any URLs... For example:
>
> RewriteEngine on
> RewriteRule ^/woot$ /beta

You may need to add a RewriteCond:
http://httpd.apache.org/docs/mod/mod_rewrite.html#RewriteCond


-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mod_rewrite Issues

2004-06-19 Thread Stephen Craton
This isn't exactly a PHP issue, but they seem to go rather hand in hand...
 
Right now I'm just running my own apache server on my computer and I'm
trying to protect my scripts using mod_rewrite. I uncommented all the
mod_rewrite lines in the apache configuration file and restarted it all. I
got no errors doing this, so I assume it compiled fine.
 
The problem is, I can put a rewrite rule in the httpd.conf file or a
.htaccess file but it never rewrites any URLs... For example:
 
RewriteEngine on
RewriteRule ^/woot$ /beta
 
I tried that as a test in a .htaccess file and put it in my root C:\htdocs
folder. I went to http://localhost/woot but it didn't show anything, gave me
a 404. I went to http://localhost/beta and it showed exactly what it was
supposed to. I assume it's something I'm doing wrong with my code, but I've
followed this sitepoint article to the point pretty much. Any help here
would be greatly appreciated...
 
Thanks,
Stephen Craton
http://www.melchior.us  
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mod_rewrite is acting up!!

2003-07-02 Thread John
ok, i had mod_rewrite working perfect: whenever some one entered
www.url.com/browse/Pop/10 it would go to
www.url.com/browse.php?category=Pop&id=10

Then I created an actual browse folder in the site root with index.php as
the only file in that folder to take over the position of the browse.php
file. and now it doesnt work at all. Now, whenever someone visits
www.url.com/browse/Pop/15, I want it to go to
www.url.com/browse/index.php?category=Pop&id=10 but it doesnt work. Instead,
it sends it to somewhere like this:
http://www.url.com/browse/index.php?category=index.php

What the hell is going on??


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mod_rewrite rules for the php.net rewritten urls

2003-06-07 Thread Philip Olson
On Sat, 7 Jun 2003, Tularis wrote:

> I was wondering where I could get the rewrite urls for the rewriting of 
> urls like here on php.net.
> 
> - Tularis
> 
> P.S. I don't think they're in the phpweb on CVS, I checked that already

What you see in phpweb is what you get, there is no
mod_rewrite, just a huge 404 handler.  For the related
sqlite stuff, see the systems cvs module.

Regards,
Philip


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mod_rewrite rules for the php.net rewritten urls

2003-06-07 Thread Tularis
I was wondering where I could get the rewrite urls for the rewriting of 
urls like here on php.net.

- Tularis

P.S. I don't think they're in the phpweb on CVS, I checked that already

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] mod_rewrite problem

2002-07-18 Thread adrian murphy



Hi,
the following code redirects www.usersite.mysite.biz  to 
www.mysite.biz/users/sites/usersite

the problem is when the 'www' is left out it doesn't work.
could someone help me to fix this?
many thanks




RewriteEngine on
RewriteCond   %{HTTP_HOST} ^www\.[^.]+\.mysite\.biz$
RewriteRule   ^(.+)%{HTTP_HOST}$1  [C]
RewriteRule   ^www\.([^.]+)\.mysite\.biz(.*) http://www.mysite.biz/users/sites/$1
RewriteCond   %{HTTP_HOST} ^www\.[^.]+\.mysite\.ie$
RewriteRule   ^(.+)%{HTTP_HOST}$1  [C]
RewriteRule   ^www\.([^.]+)\.mysite\.ie(.*) http://www.mysite.biz/users/sites/$1


adrian.



[PHP] mod_rewrite & open_basedir & pear

2002-05-27 Thread Alexei Tenitski

Hi

Can anyone please help me with a following problem.

There's a script which uses PEAR library (namely, DB class)

getMessage());

var_dump($db);

?>


When i execute it everything is ok.

BUT when i access this script via redirect by mod_rewrite
it throws an error that open_basedir settings don't allow
this require to be made 

.htaccess:
RewriteEngine on
RewriteRule   test2.php  /~xaxa/test/test3.php [L]

test2.php,test3.php contain the code that i quoted above

error:

Warning:  open_basedir restriction in effect. File is in wrong directory
in /home/xaxa/public_html/test/test3.php on line 4

Fatal error:  Failed opening required 'DB.php'
(include_path='.:/usr/local/lib/php') in
/home/xaxa/public_html/test/test/test3.php on line 4



Is there any way to overcome this problem?

mod_rewrite is used to _hide_ urls from users and to _extend_ url with
additional params.


Alexei

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] mod_rewrite (solution)

2002-04-17 Thread [ rswfire ]

Thanks to everyone who tried to help.  Apparently, I'm better at this stuff 
than I thought.  The four lines below provide the perfect solution to the 
problem I was having.

RewriteEngine  on
RewriteBase/
RewriteCond%{REQUEST_FILENAME} !-f
RewriteRule^(.+) /index.php



_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] mod_rewrite

2002-04-17 Thread [ rswfire ]

I could really use your help with this.  The examples I have received from 
everyone thus far have not worked, including the last one that you posted.  
This is the situation:

I have multiple domains, each with multiple subdomains, all of which 
automatically point to the root of my web environment.  I have only one file 
that does all of the work for all of these websites/webpages, and that is 
the index.php file in the root.  This file is smart enough to parse the url 
being accessed and create an appropriate page based on a very complex set of 
rules.

Originally, I was using the ErrorDocument 404 to make it access the 
index.php file, but this has some inherent flaws.  The biggest problem was 
that forms that were being posted to a page that doesn't really exist never 
maintained the posted variables (due to the 404 redirect.)  Another 
limitation was that it just created a bunch of unnecessary error messages in 
my error log since there are no "real pages" on my network, even though it 
pretends there is.

So, I need to use mod_rewrite.  That is apparent now.  The problem is I know 
nothing about creating regular expressions.  I simply need it to rewrite the 
url for any file that does not exist (it should not try to do so for a file 
that really does exist, say an image file) and it needs to have the 
following rule:

A*.B*.C*/D*.E*

Where A is a subdomain; B is the domain name; C is the top level domain; D/E 
are a file or directory.

Some examples would be:

http://www.swifte.net/
http://www.cao.swifte.net/petition-sign.html
http://hsdnetwork.swifte.net/technicians.html
http://www.hsdnetwork.swifte.net/technicians.html
http://www.caofund.org/
http://www.hsdnetwork.com/

Can you tell me how to do this?  I would appreciate your help so much!!

-Samuel

_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] mod_rewrite (the solution)

2002-04-17 Thread [ rswfire ]

RewriteEngine  on
RewriteBase/
RewriteRule$.* index.php


Original Message Follows
From: "SHEETS,JASON (Non-HP-Boise,ex1)" <[EMAIL PROTECTED]>
To: "'[ rswfire ]'" <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Subject: RE: [PHP] Would this work? (mod_rewrite)
Date: Wed, 17 Apr 2002 18:29:25 -0400

And I fall victim to my own stupidity/cache again.

You actually want


RewriteEngine on
RewriteBase /
RewriteRule ^$ index.php

This works for me on my domain, you can check it out by going to
http://demo.shadotechdesigns.com and http://bug.shadonet.com

Jason

-Original Message-
From: [ rswfire ] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 17, 2002 4:20 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Would this work? (mod_rewrite)


This rewrite thing will actually be very good for me; my error log file will

stop having a million "file not found" errors  :-)

I have to tell you guys, I love JTL Networks.  They are the best host I have

ever had ever!


Original Message Follows
From: Miguel Cruz <[EMAIL PROTECTED]>
To: "[ rswfire ]" <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
Subject: Re: [PHP] Would this work? (mod_rewrite)
Date: Wed, 17 Apr 2002 17:14:13 -0500 (CDT)

Do you have access to your server's error_log file? With any luck there'll
be a more informative message there (something like "Miguel was too lazy
to pay sufficient attention to the following Rewrite caveat: xxx").

miguel

On Wed, 17 Apr 2002, [ rswfire ] wrote:

  > mod_bwlimited, mod_php4, mod_log_bytes, mod_frontpage, mod_ssl,
  > mod_setenvif, mod_so, mod_auth, mod_access, mod_rewrite, mod_alias,
  > mod_userdir, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir,
  > mod_autoindex, mod_include, mod_status, mod_negotiation, mod_mime,
  > mod_log_config, mod_env, http_core
  >
  >
  > Original Message Follows
  > From: Miguel Cruz <[EMAIL PROTECTED]>
  > To: "[ rswfire ]" <[EMAIL PROTECTED]>
  > CC: [EMAIL PROTECTED]
  > Subject: Re: [PHP] Would this work?  (mod_rewrite)
  > Date: Wed, 17 Apr 2002 16:55:33 -0500 (CDT)
  >
  > On Wed, 17 Apr 2002, [ rswfire ] wrote:
  >  > Assume I want *.domain.*/*.* to automatically call index.php (without
the
  >  > user knowing and without any redirecting at all):
  >  >
  >  > RewriteEngine  on
  >  > RewriteBase/
  >  > RewriteRule*.* index.php [R]
  >  >
  >  > I don't know what in the world the [R] is, but it's in almost all of
the
  >  > mod_rewrite examples...  :-)
  >
  > RewriteRule * index.php
  >
  > Don't use the [R] - that tells it to create an external redirect. It's
  > used in many of the examples because in many real-world cases people are
  > using rewrite rules to coax invalid URLs into valid ones, and this way
  > there's at least some chance that the bad ones will get updated.
  >
  > miguel
  >
  >
  >
  >
  >
  > _
  > Send and receive Hotmail on your mobile device: http://mobile.msn.com
  >
  >
  >





_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] mod_rewrite

2002-04-17 Thread [ rswfire ]

.htaccess  (returns 500 misconfiguration error message)
{

RewriteEngine  on
RewriteBase/
RewriteRule* index.php

}

http://swifte.net/phpinfo.php

(i did not use braces in the .htaccess file)

_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] mod_rewrite

2002-03-01 Thread Adrian Murphy

I'm building a website buider app and I'm giving users a
url of the form  username.mysite.com but I want to redirect
all url's that end with mysite.com to a script and query
the db based on username.I've learned that I need to use
mod_rewrite for this.The documentation suggests that this will cause
extra load on the cpu.should I be worried about this?
I'm hosting with a third party.What will their reaction to this be.
Has anyone done this sort of thing and is it advisable.
I don't want to redirect from a 404 page as there's a search engine issue with that.
As a side issue,there may be a lot of database updating
involed in the site and i'm wondering should i use mysql(i am at the moment).
any real world examples of the performance of mysql?I know it's great for selects.
Thanx
adrian murphy



RE: [PHP] mod_rewrite

2001-09-09 Thread Matthew Loff


Good point, felix...

I didn't even think of catch-all DNS domains...  I don't know how to set
them up, but I'm sure with a catch-all and mod_rewrite, you can
accomplish something useful.

Check google for "catch all dns" or something of the like.

--Matt


-Original Message-
From: Felix [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, September 09, 2001 1:38 PM
To: [EMAIL PROTECTED]; 'Matthew Loff'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] mod_rewrite


How about http://wasarrested.com? IO don't know how they do it, but you
can enter whatever subdomain you want and it reflecst it on the weppage.
Example http://bill.clinton.wasarrested.com or youri.wasarrested.com.

Felix

-Original Message-
From: BRACK [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, September 09, 2001 2:43 PM
To: Matthew Loff
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] mod_rewrite


> 
> Subdomains are first a DNS issue...  The first place you have to go is

> your DNS config, since users.body-builders.org wouldn't exist without
> an A or CNAME record.
My subdomains do not have DNSs =(( and I'm not sure if I can 
change this issue with .htaccess
> 
> I don't know if mod_rewrite can do anything about the subdomains like
> that, if it can't, you will have to add VirtualHost directives to 
> httpd.conf for each subdomain.
But if I assign VirtualHost users.body-builders.org using DNS of 
www.body-builders.org (the onli one I have) all visitors will go to 
www.body-builders.org and not to users.body-builders.org?

Thank you,

Youri
<>< <>< <>< <>< God is our provider ><> ><> ><> ><> 
http://www.body-builders.org
New!!! - http://body-builders.org/index.php?links=1

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] To
contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] To
contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] mod_rewrite

2001-09-09 Thread Felix

How about http://wasarrested.com? IO don't know how they do it, but you
can enter whatever subdomain you want and it reflecst it on the weppage.
Example http://bill.clinton.wasarrested.com or youri.wasarrested.com.

Felix

-Original Message-
From: BRACK [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, September 09, 2001 2:43 PM
To: Matthew Loff
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] mod_rewrite


> 
> Subdomains are first a DNS issue...  The first place you have to go is

> your DNS config, since users.body-builders.org wouldn't exist without 
> an A or CNAME record.
My subdomains do not have DNSs =(( and I'm not sure if I can 
change this issue with .htaccess
> 
> I don't know if mod_rewrite can do anything about the subdomains like 
> that, if it can't, you will have to add VirtualHost directives to 
> httpd.conf for each subdomain.
But if I assign VirtualHost users.body-builders.org using DNS of 
www.body-builders.org (the onli one I have) all visitors will go to 
www.body-builders.org and not to users.body-builders.org?

Thank you,

Youri
<>< <>< <>< <>< God is our provider ><> ><> ><> ><> 
http://www.body-builders.org
New!!! - http://body-builders.org/index.php?links=1

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] To
contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] mod_rewrite

2001-09-09 Thread BRACK

> 
> Subdomains are first a DNS issue...  The first place you have to go is
> your DNS config, since users.body-builders.org wouldn't exist without
> an A or CNAME record.
My subdomains do not have DNSs =(( and I'm not sure if I can 
change this issue with .htaccess
> 
> I don't know if mod_rewrite can do anything about the subdomains like
> that, if it can't, you will have to add VirtualHost directives to
> httpd.conf for each subdomain.
But if I assign VirtualHost users.body-builders.org using DNS of 
www.body-builders.org (the onli one I have) all visitors will go to 
www.body-builders.org and not to users.body-builders.org?

Thank you,

Youri
<>< <>< <>< <>< God is our provider ><> ><> ><> ><> 
http://www.body-builders.org
New!!! - http://body-builders.org/index.php?links=1

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] mod_rewrite

2001-09-09 Thread Matthew Loff


Subdomains are first a DNS issue...  The first place you have to go is
your DNS config, since users.body-builders.org wouldn't exist without an
A or CNAME record.

I don't know if mod_rewrite can do anything about the subdomains like
that, if it can't, you will have to add VirtualHost directives to
httpd.conf for each subdomain.

--Matt


-Original Message-
From: BRACK [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, September 09, 2001 12:55 PM
To: [EMAIL PROTECTED]
Subject: [PHP] mod_rewrite


I have a website URL www.body-builders.org and users have URLs 
like www.body-builders.org/user According to the virtual hosting 
rules I can do any configuration tweaks by .htaccess file.

What I want to do is to offer my users URLs like users.body-
builders.org Is it possible to do with rewrite rules in .htaccess?

I tried this in my .htaccess but it doesnt help - 

RewriteEngine   on
RewriteCond %{HTTP_HOST}^users\.body-builders\.org$
RewriteRule ^.*$http://www.body-
builders.org/users/indexr.php [L]

Youri

PS there are three lines in code.
<>< <>< <>< <>< God is our provider ><> ><> ><> ><> 
http://www.body-builders.org
New!!! - http://body-builders.org/index.php?links=1

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] To
contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] mod_rewrite

2001-09-09 Thread BRACK

I have a website URL www.body-builders.org and users have URLs 
like www.body-builders.org/user According to the virtual hosting 
rules I can do any configuration tweaks by .htaccess file.

What I want to do is to offer my users URLs like users.body-
builders.org Is it possible to do with rewrite rules in .htaccess?

I tried this in my .htaccess but it doesnt help - 

RewriteEngine   on
RewriteCond %{HTTP_HOST}^users\.body-builders\.org$
RewriteRule ^.*$http://www.body-
builders.org/users/indexr.php [L]

Youri

PS there are three lines in code.
<>< <>< <>< <>< God is our provider ><> ><> ><> ><> 
http://www.body-builders.org
New!!! - http://body-builders.org/index.php?links=1

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] mod_rewrite starts driving me crazy ...

2001-02-11 Thread Richard Lynch

> This works perfectly, however what I really need to do is to make it work
> not only with /index.html but with everything typed in your browser...
> (index.html was only a test to let me know I am in a right direction)
>
> I tried:
>
> RewriteRule   ^(.*)  /start.php?go=$1
> RewriteRule   ^(.*)$  /start.php?go=$1
> RewriteRule   ^(.+)  /start.php?go=$1
> RewriteRule   ^(.+)$  /start.php?go=$1
>
> RewriteRule   ^(/.*)  /start.php?go=$1
> RewriteRule   ^(/.*)$  /start.php?go=$1
> RewriteRule   ^(/.+)  /start.php?go=$1
> RewriteRule   ^(/.+)$  /start.php?go=$1

Having just spent about 16 hours fighting with mod_rewrite to try and
replace broken DefaultType on FreeBSD, I feel your pain :-)

My thinking in this case is:  It really doesn't make sense to have either ^
or $ here, since you really don't care what you start or end with.  So, you
probably just want:

RewriteRule (.*) /start.php?go=$1

Except, of course, that will be an infinite loop, since that matches
start.php?go=index.html as well.

So, what I think you *really* want is:

RewriteRule ^/start\.php.* - [L]
RewriteRule (.*) /start.php?go=$1

Translation:
#1  If we are surfing to "/start.php?blahblahblah", then use the URL as-is
"-" and stop playing these silly rewrite games "[L]"
#2 Any URL that reaches this rule, wasn't one of our start.php hacks, so
redirect to start.php

You may need or want a [R] on the end of that second rule...

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] mod_rewrite starts driving me crazy ...

2001-02-10 Thread Maxim Maletsky

Hello guys,

I know it is not exactly a PHP problem, it is about apache's mod_rewrite
which after 4 hours of tentative till 3.30am starts making me think that I
need a LONG vacation ...

I know it's easy... I read all the docs dozens of times and I *feel* that I
am very close to the solution ... please help. ...



Here:
my system: Win2k, Apache 1.3.14, (my test server)
my problem:

in the virtual host of httpd.conf I added the following:

RewriteEngine On
RewriteRule   ^(/index.html)$  /start.php?go=$1  

This works perfectly, however what I really need to do is to make it work
not only with /index.html but with everything typed in your browser...
(index.html was only a test to let me know I am in a right direction)

I tried:


RewriteRule   ^(.*)  /start.php?go=$1
RewriteRule   ^(.*)$  /start.php?go=$1
RewriteRule   ^(.+)  /start.php?go=$1
RewriteRule   ^(.+)$  /start.php?go=$1

RewriteRule   ^(/.*)  /start.php?go=$1
RewriteRule   ^(/.*)$  /start.php?go=$1
RewriteRule   ^(/.+)  /start.php?go=$1
RewriteRule   ^(/.+)$  /start.php?go=$1


...non of these worked    while something's telling me it had to

Is that a flag that I need ?
(I've tried some combinations of these - didn't work either, I think I need
to confirm it by someone)

please help me with that, I know many of you have done it already... or I am
going to dream about apachectl restart tonight 

Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]