freelanceprogrammers.org Forum Index » PHP
A little Rewritting help
Joined: 08 Oct 2005
Posts: 5
A little Rewritting help
Hello
I again need you help in url rewritting.
Here are these types of urls in my site
http://www.vacanzeromane.com/eng/apartment_page.php?apart_id=159&name=s.clemente
http://www.vacanzeromane.com/eng/apartment_page.php?apart_id=175&name=residence
apt. 12
yes there is space between urls.
currently i m rewrtting these urls to
http://www.vacanzeromane.com/eng/159-apartment-s.clemente
http://www.vacanzeromane.com/eng/175-apartment-residence apt. 12
I m doing this mapping using the following code
function replace_for_mod_rewrite(&$s)
{
$urlin =
array(
"`(?<!/)apartment_page.php?apart_id=([0-9]*)&name=(([[:alnum:]]|[[:blank:]]|[[:
punct:]])*)`",
);
$urlout = array(
"\1-apartment-\2",
);
$s = preg_replace($urlin, $urlout, $s);
return $s;
}
and it is working fine.
but in browser the 2nd url looks like that
http://www.vacanzeromane.com/eng/175-apartment-residence%20apt.%2012
I also want to replace a space any where in the apartment name to be replaced by
- so that the urlshould be look like that
http://www.vacanzeromane.com/eng/175-apartment-residence-apt.-12
Can any one help me in this regard.
Waiting for your infomative help
Thanks
JUNAID JAMEEL AHMAD
BSc Hons in CS Punjab University Lahore Pakistan
---------------------------------
Yahoo! FareChase - Search multiple travel sites in one click.
[Non-text portions of this message have been removed]
Joined: 08 Oct 2005
Posts: 5
A little Rewritting help
Hello
I again need you help in url rewritting.
Here are these types of urls in my site
http://www.vacanzeromane.com/eng/apartment_page.php?apart_id=159&name=s.clemente
http://www.vacanzeromane.com/eng/apartment_page.php?apart_id=175&name=residence
apt. 12
yes there is space between urls.
currently i m rewrtting these urls to
http://www.vacanzeromane.com/eng/159-apartment-s.clemente
http://www.vacanzeromane.com/eng/175-apartment-residence apt. 12
I m doing this mapping using the following code
function replace_for_mod_rewrite(&$s)
{
$urlin =
array(
"`(?<!/)apartment_page.php?apart_id=([0-9]*)&name=(([[:alnum:]]|[[:blank:]]|[[:
punct:]])*)`",
);
$urlout = array(
"\1-apartment-\2",
);
$s = preg_replace($urlin, $urlout, $s);
return $s;
}
and it is working fine.
but in browser the 2nd url looks like that
http://www.vacanzeromane.com/eng/175-apartment-residence%20apt.%2012
I also want to replace a space any where in the apartment name to be replaced by
- so that the urlshould be look like that
http://www.vacanzeromane.com/eng/175-apartment-residence-apt.-12
Can any one help me in this regard.
Waiting for your infomative help
Thanks
JUNAID JAMEEL AHMAD
BSc Hons in CS Punjab University Lahore Pakistan
---------------------------------
Yahoo! FareChase - Search multiple travel sites in one click.
[Non-text portions of this message have been removed]
Joined: 08 Nov 2005
Posts: 5
A little Rewritting help
Hello, since we are posting in php-objects, I`d like to say it would be a
good idea if we can design a php class to do url rewriting on the fly, by
replacing urls, using ob_start() and other goodies.
Laurent.
2005/11/8, *^*JUNAID*^* <junaidfcs@...>:
>
> Hello
> I again need you help in url rewritting.
> Here are these types of urls in my site
>
>
>
http://www.vacanzeromane.com/eng/apartment_page.php?apart_id=159&name=s.clemente
>
>
http://www.vacanzeromane.com/eng/apartment_page.php?apart_id=175&name=residencea
pt. 12
>
>
>
> yes there is space between urls.
> currently i m rewrtting these urls to
> http://www.vacanzeromane.com/eng/159-apartment-s.clemente
> http://www.vacanzeromane.com/eng/175-apartment-residence apt. 12
> I m doing this mapping using the following code
>
>
> function replace_for_mod_rewrite(&$s)
> {
> $urlin =
> array(
>
"`(?<!/)apartment_page.php?apart_id=([0-9]*)&name=(([[:alnum:]]|[[:blank:]]|[[:
punct:]])*)`",
>
> );
> $urlout = array(
> "\1-apartment-\2",
> );
> $s = preg_replace($urlin, $urlout, $s);
> return $s;
> }
>
> and it is working fine.
> but in browser the 2nd url looks like that
> http://www.vacanzeromane.com/eng/175-apartment-residence%20apt.%2012
>
> I also want to replace a space any where in the apartment name to be
> replaced by - so that the urlshould be look like that
> http://www.vacanzeromane.com/eng/175-apartment-residence-apt.-12
>
> Can any one help me in this regard.
> Waiting for your infomative help
> Thanks
>
>
>
>
>
> JUNAID JAMEEL AHMAD
> BSc Hons in CS Punjab University Lahore Pakistan
>
>
>
> ---------------------------------
> Yahoo! FareChase - Search multiple travel sites in one click.
>
> [Non-text portions of this message have been removed]
>
>
>
> PHP Data object relational mapping generator -
> http://www.meta-language.net/
>
>
> ------------------------------
> YAHOO! GROUPS LINKS
>
>
> - Visit your group "php-objects<http://groups.yahoo.com/group/php-objects>"
> on the web.
> - To unsubscribe from this group, send an email to:
>
php-objects-unsubscribe@yahoogroups.com<php-objects-unsubscribe@yahoogroups.com?
subject=Unsubscribe>
> - Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service <http://docs.yahoo.com/info/terms/>.
>
>
> ------------------------------
>
--
La philosophie cynique a pour but ultime la sagesse, une éthique de vie.
Selon Antisthène, aucun discours ne vaut, aucune étude ni savoir.
Antisthène - <http://www.le-valdo.com>
[Non-text portions of this message have been removed]
Joined: 08 Nov 2005
Posts: 1
A little Rewritting help
Hi freinds,
I am a regular reader of all the group mails......
I would be thankfull if somebody can tell me how can i replace the URL
I am running a .NET site eg www.abcd.com/check_status.aspx.
Now i have one page in php which is placed at
http://192.192.192.192/demo/tell_status.php
which is called from .NET site.
Can i replace the URL http://192.192.192.192/demo/tell_status.php to
www.abcd.com/check_status.aspx. ???
Thanks in advance
Anupam
---------------------------------
Yahoo! FareChase - Search multiple travel sites in one click.
---------------------------------
Yahoo! FareChase - Search multiple travel sites in one click.
[Non-text portions of this message have been removed]
All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
China Wholesale - Electronics Products
Character Studio - Tutorials and Help
China Wholesale - Electronics Products
Character Studio - Tutorials and Help







