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)
-   -   htaccess rewrite question.. (https://gfy.com/showthread.php?t=700479)

poe 01-28-2007 07:48 PM

htaccess rewrite question..
 
i have a site with a bunch of php files like this:

http://www.site.com/cookies.php
http://www.site.com/milk.php

is it possible to make a rewrite so the links would look like this?

http://www.site.com/cookies
http://www.site.com/milk

thanks a bunch :)

SmokeyTheBear 01-28-2007 08:46 PM

http://www.sitepoint.com/article/sea...riendly-urls/3

Bro Media - BANNED FOR LIFE 01-28-2007 08:54 PM

RewriteRule ^/([^/]+)*$ $1.php

that should work, but don't make any .php files that have folders with the same name or it will fuck with it

poe 01-28-2007 09:22 PM

hmm, thanks for the help guys.

somehow i can't get it to work.

should my htaccess file have more than this:

RewriteEngine on
RewriteRule ^/([^/]+)*$ $1.php

?

Bro Media - BANNED FOR LIFE 01-28-2007 10:05 PM

Quote:

Originally Posted by poe (Post 11809190)
hmm, thanks for the help guys.

somehow i can't get it to work.

should my htaccess file have more than this:

RewriteEngine on
RewriteRule ^/([^/]+)*$ $1.php

?

yes

8chars....

poe 01-28-2007 10:13 PM

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1.php [L,QSA]

that worked. thanks!


All times are GMT -7. The time now is 05:34 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123