Unix/Linux Go Back    


Web Programming Discuss Web Programming and Web Server Administration, including LAMP, Apache, MySQL, HTML, SEO, and other Web APIs and topics.

Apache mod_rewrite: from 'friendly' url to actual path

Web Programming


Tags
apache, apache2, mod_rewrite, url

Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 09-05-2009   -   Original Discussion by markericksen
markericksen's Unix or Linux Image
markericksen markericksen is offline
Registered User
 
Join Date: Sep 2009
Last Activity: 6 September 2009, 12:41 PM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Apache mod_rewrite: from 'friendly' url to actual path

I'd like to translate a friendly url such as:
http://www.xxxyyyzzz.com/page/12345678/
to:
http://www.xxxyyyzzz.com/page/12/34/56/78/

Seems simple enough, but I cannot figure out how. Any one done this before?
Sponsored Links
    #2  
Old Unix and Linux 09-06-2009   -   Original Discussion by markericksen
Neo's Unix or Linux Image
Neo Neo is online now Forum Staff  
Administrator
 
Join Date: Sep 2000
Last Activity: 13 December 2017, 11:38 AM EST
Location: Asia pacific region
Posts: 14,091
Thanks: 934
Thanked 1,270 Times in 608 Posts
Quote:
Originally Posted by markericksen View Post
I'd like to translate a friendly url such as:
http://www.xxxyyyzzz.com/page/12345678/
to:
http://www.xxxyyyzzz.com/page/12/34/56/78/

Seems simple enough, but I cannot figure out how. Any one done this before?
I have not tried this, but, off the top of my head, you can try something like:


Code:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^page\/([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})\/$  page/$1/$2/$3/$4/   [R=301,NC,L]

Sponsored Links
    #3  
Old Unix and Linux 09-06-2009   -   Original Discussion by markericksen
markericksen's Unix or Linux Image
markericksen markericksen is offline
Registered User
 
Join Date: Sep 2009
Last Activity: 6 September 2009, 12:41 PM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thank you. Your response was very helpful!
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
mod_rewrite help Adrnalnrsh Web Programming 0 08-05-2009 08:02 PM
why do apache redirect me to the same path ? aneuryzma Web Programming 1 05-25-2009 08:26 AM
mod_rewrite RewriteMap - possible to 404? sneakyimp Web Programming 0 04-16-2009 12:22 PM
mod_rewrite problem arsonist Shell Programming and Scripting 0 08-28-2008 03:04 PM
how to check the actual path instead of link path reldb UNIX for Advanced & Expert Users 4 10-04-2006 10:55 AM



All times are GMT -4. The time now is 12:43 PM.