![]() |
URL Cleanup (&, ? to / )
Hi,
Sites like amazon have what look like static pages for example: http://www.amazon.co.uk/exec/obidos/...268978-5527820 but these pages are infact dynamic as amazon has some sort of rewrite module installed to convert the /'s to & (variables). If I wanted to change my PHP pages in this way using apache, how would I do it? From this: http://www.mysite.com/?page=articles...002&date=today to this: www.mysite.com/page=articles/id=10002/date=today :thumbsup |
|
Quote:
I've been using the method described on page 2 for a long time now, works great. |
you need to use mod_rewrite
place a .htaccess file in the directory, generally the root directory. .htaccess -------------------------- RewriteEngine on RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [L] RewriteRule ^([0-9a-z]+)/?$ index.php?variable=$1 [L] is a basic example anything in the () that matches the regular expression is placed in $1, if you have another () then $2 will exist take a look at http://httpd.apache.org/docs/misc/rewriteguide.html i'm still pretty new to it, so i hope this all makes sense :) hope it helps ryan |
Quote:
It seems to work in my tests, thank you :thumbsup |
hmm... that could be real useful for google....
now the rocks in my head are bangin together.... |
cheers AdultNex
|
All times are GMT -7. The time now is 07:28 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123