freelanceprogrammers.org Forum Index » PHP

Need help using mod_rewrite


View user's profile Post To page top
junaidfcs Posted: Sat Oct 08, 2005 10:49 am


Joined: 08 Oct 2005

Posts: 5
Need help using mod_rewrite
Hello
Can any one tell me i have a link in my website
http://www.vacanzeroman.com/apartment_page?apart_id=158
to dynamiclly adjust to
http://www.vacanzeroman.com/158-apartment-page.php
where apart_id=158 ... so on is genereted dynamically in a variable from the
database...
Please help me
If any one have some example of source code with features like that please also
show me...
Thanks in advance
Junaid



JUNAID JAMEEL AHMAD
BSc Hons in CS Punjab University Lahore Pakistan



---------------------------------
Yahoo! Music Unlimited - Access over 1 million songs. Try it free.

[Non-text portions of this message have been removed]
Reply with quote
Send private message
View user's profile Post To page top
dewebbster Posted: Sun Oct 09, 2005 8:00 pm


Joined: 06 Sep 2005

Posts: 16
Need help using mod_rewrite
OSCommerce uses a similar idea to do just the reverse, I think.
The .htaccess file at the top of the web directory has this:

RewriteEngine On
# Change "folder" to your catalog directory name
# RewriteBase /folder/
RewriteBase /
RewriteRule ^(.*)-p-(.*).html$
product_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-m-(.*).html$
index.php?manufacturers_id=$2&%{QUERY_STRING}

This allows "search-engine-friendly" URLs to work, like so:
http://aeorienteering.com/activeankle-ankle-support-p-322.html
(generated by the shopping cart) is translated upon arrival to
http://aeorienteering.com/product_info.php?products_id=322

The string before the -p- is of no consequence, it is ignored. it is
generated from the product name, or a data field in the product info
table. Other plain php functions translate the url into the strings
with the keys -p-, -c- or -m- and mod-rewrite translates them back to
the query string.

-m



On Oct 8, 2005, at 12:49 AM, *^*JUNAID*^* wrote:

> Hello
> Can any one tell me i have a link in my website
> http://www.vacanzeroman.com/apartment_page?apart_id=158
> to dynamiclly adjust to
> http://www.vacanzeroman.com/158-apartment-page.php
> where apart_id=158 ... so on is genereted dynamically in a variable
> from the database...
> Please help me
> If any one have some example of source code with features like that
> please also show me...
> Thanks in advance


[Non-text portions of this message have been removed]
Reply with quote
Send private message
View user's profile Post To page top
dkiplagat@... Posted: Wed Oct 12, 2005 10:22 am


Joined: 12 Oct 2005

Posts: 1
Need help using mod_rewrite
Pass the variable throu a form and get it throus POST method
----- Original Message -----
From: "*^*JUNAID*^*" <junaidfcs@...>
To: "PHP GURUS" <php-gurus@yahoogroups.com>; <php-objects@yahoogroups.com>
Sent: Saturday, October 08, 2005 8:49 AM
Subject: [php-objects] Need help using mod_rewrite


> Hello
> Can any one tell me i have a link in my website
http://www.vacanzeroman.com/apartment_page?apart_id=158
> to dynamiclly adjust to
> http://www.vacanzeroman.com/158-apartment-page.php
> where apart_id=158 ... so on is genereted dynamically in a variable from
the database...
> Please help me
> If any one have some example of source code with features like that
please also show me...
> Thanks in advance
> Junaid
>
>
>
> JUNAID JAMEEL AHMAD
> BSc Hons in CS Punjab University Lahore Pakistan
>
>
>
> ---------------------------------
> Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
>
> [Non-text portions of this message have been removed]
>
>
>
>
>
>
> PHP Data object relational mapping generator -
http://www.meta-language.net/
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
>
> -----------------------------------------------
> postmaster@...
> This message was scanned for spam and viruses by BitDefender.
> -----------------------------------------------
>
>



-----------------------------------------------
postmaster@...
This message was scanned for spam and viruses by BitDefender.
-----------------------------------------------
Reply with quote
Send private message
Post new topic Reply to topic
Display posts from previous:   
 

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
Freelace Website Designer - Customer web design and software building.
Booking Calendar - reservation calendar script
Land Surveying - total station instruments and equipments
China Wholesale - Electronics Products
Character Studio - Tutorials and Help