GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   URL Cleanup (&, ? to / ) (https://gfy.com/showthread.php?t=214003)

cj-design 12-28-2003 02:51 PM

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

AdultNex 12-28-2003 02:59 PM

http://www.sitepoint.com/article/485

fuzebox 12-28-2003 03:02 PM

Quote:

Originally posted by AdultNex
http://www.sitepoint.com/article/485
:thumbsup

I've been using the method described on page 2 for a long time now, works great.

pornanza 12-28-2003 03:03 PM

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

smproduction 12-29-2003 02:38 AM

Quote:

Originally posted by AdultNex
http://www.sitepoint.com/article/485

It seems to work in my tests, thank you :thumbsup

Mr Pheer 12-29-2003 02:43 AM

hmm... that could be real useful for google....

now the rocks in my head are bangin together....

cj-design 12-29-2003 05:23 PM

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