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)
-   -   Any Mod Rewrite Gurus here? (https://gfy.com/showthread.php?t=221934)

TheJimmy 01-16-2004 06:26 PM

Any Mod Rewrite Gurus here?
 
RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteRule ^\tata.html$ /file.html




how do I get the 'tata' part to wildcard?





a friend asked me and I'm one stumped mofo....





thanks in advance....

hudson 01-16-2004 06:56 PM

RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteRule ^\tata.html$ /file.html

OK, on the RewriteBase part, you got to put your subdirectory
RewriteBase /sub1/

Then

RewriteRule ^tata.html$ file.html

should work...but I would have to test it...you just want to rewrite tata.html to file.html, correct?

Wiz 01-16-2004 07:17 PM

Not sure but ...

RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteRule ^(.*)\.html$ file.html

If you want the wildcard before the .html part ;)

hudson 01-16-2004 07:26 PM

Quote:

Originally posted by Wiz
Not sure but ...

RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteRule ^(.*)\.html$ file.html

If you want the wildcard before the .html part ;)

that would make any html file rewrite to file.html

Wiz 01-16-2004 07:26 PM

Thats what the guy asked it seem .. hehe

DerekT 01-16-2004 07:54 PM

Try this:

RewriteEngine On
Options -indexes
RewriteRule ^(.*).html$ /DIRECTORY/$1.html [L]

Replace DIRECTORY with a sub. If you do this:
RewriteRule ^(.*).html$ /$1.html [L]
It would create a loop and fail.

Or for a dynamic solution:
RewriteRule ^(.*).html$ /view.php?cat=$1 [L]

Creating a file called view.php to accept variables would then do this:
/free-sex-pics.html would translate to /view.php?cat=free-sex-pics

You could then have the view.php create a page with titles, alt tags, headers, etc for search engines.

Hope it helps.

DerekT 01-16-2004 07:55 PM

http://httpd.apache.org/docs/mod/mod_rewrite.html

Here is another good page, but a long read.

Wiz 01-16-2004 08:04 PM

DerekT , thanks for the php part and variable ;)

DerekT 01-16-2004 08:09 PM

No problem. I had a project a while back to create a totaly dynamic sex toy store. I took their entire spread sheet, imported it to MySQL, create custom php, download all the images and thumbnails. Walah, a toy store, with search engine friendly pages numbering over 15,000 products. The sweetness of it is when there are changes in the search engines, I can tweak just two files and all the products are updated to rank better.

Wiz 01-16-2004 08:29 PM

yup the best way ;)


All times are GMT -7. The time now is 10:39 PM.

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