Forum Moderators: phranque
i have a phone page like
its works like
www.site.com/phone.php?id=4
i used mod rewrite like thisfitst
PHP Code:
RewriteEngine On
RewriteBase /
RewriteRule ^([^/.]+)/?$ /phone.php?id=$1 [L]
so url is like this site.com/4 and it points to site.com/phone.php?id=4
PHP Code:
RewriteEngine On
RewriteBase /
RewriteRule ^phone.*-([0-9]*).html$ /phone.php?id=$1 [L]
site.com/phone-4.html and it points to site.com/phone.php?id=4
i want to build url like site.com/brand-model-id.php
but i want to use only id parameter
how to do?
i want to use the brand and model only in url
but only id is the parameter passed to phone.php
how do i do it
please help
Welcome to WebmasterWorld!
Our forum charter [webmasterworld.com] contains a link to a regular-expressions tutorial which you may find helpful.
> i want to build url like site.com/brand-model-id.php
RewriteRule ^[^\-]+-[^\-]+-(.+)$ /phone.php?id=$1 [L]
Jim
[domain.com...]
how do i make it of the form
[domain.com...]
i am new to mod_rewrite
please help
Use this, it'll be faster:
RewriteEngine On
RewriteBase /
RewriteRule ^[^\-]+-[^\-]+-([^.]+)\.php$ /phone.php?id=$1
Jim