Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 09-16-2005, 01:43 PM   #1
X37375787
Guest
 
Posts: n/a
htaccess question

On one of my sites I run WordPress and have permalinks setup via mod_rewrite. Currently, the posts appear as directories like

http://www.domain.com/category/postname/

I know I could change the permalink structure in the script itself to postname.html - but then the pages indexed by SEs would return 404s all across the site.

Is there a way to divert requests for directories to the virtual .html files as specified by the new rewrite rules?
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-16-2005, 01:44 PM   #2
X37375787
Guest
 
Posts: n/a
So

http://www.domain.com/category/postname/

would automatically 301 to

http://www.domain.com/category/postname.html
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-16-2005, 01:46 PM   #3
pornpf69
Too lazy to set a custom title
 
pornpf69's Avatar
 
Join Date: Jun 2004
Location: Brasil
Posts: 15,778
I am sorry but I can help on this matter...good luck with it!
pornpf69 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-16-2005, 01:57 PM   #4
X37375787
Guest
 
Posts: n/a
Quote:
Originally Posted by pornpf69
I am sorry but I can help on this matter...good luck with it!
I guess you mean to say you can't help with this matter
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-16-2005, 02:11 PM   #5
Realpascal
Confirmed User
 
Join Date: Jun 2005
Location: Dutchie !!!
Posts: 2,119
Bump for you.
__________________
OMGWTFBBQ
Realpascal is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-16-2005, 02:20 PM   #6
kektex
Confirmed User
 
Industry Role:
Join Date: Mar 2005
Location: elkektex at gmail
Posts: 1,813
try webmasterworld.com
They have a bunch of very knowledgeable people on the apache forum
__________________
exgfmovies.com, exgfclips.com, datesx.com, gayboards.com and more!
kektex is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-16-2005, 02:26 PM   #7
The Sultan Of Smut
Confirmed User
 
The Sultan Of Smut's Avatar
 
Join Date: Dec 2004
Location: Vancouver
Posts: 4,325
I searched for this:

http://www.google.com/search?sourcei...q=htaccess+301

and found this:

http://www.tamingthebeast.net/articl...1-redirect.htm
The Sultan Of Smut is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-16-2005, 02:31 PM   #8
psili
Confirmed User
 
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
Haven't tested it, but something like:

Code:
RewriteEngine on
RewriteRule categories/(.*)/? categories/$1.html [R=301]
__________________
Your post count means nothing.
psili is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-16-2005, 02:36 PM   #9
psili
Confirmed User
 
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
Here's a handly little rewrite cheat sheet for you mod rewrite fans from some dude who apparently digs on jack daniels:

http://www.ilovejackdaniels.com/mod_...heat_sheet.png
__________________
Your post count means nothing.
psili is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-16-2005, 02:51 PM   #10
pornpf69
Too lazy to set a custom title
 
pornpf69's Avatar
 
Join Date: Jun 2004
Location: Brasil
Posts: 15,778
Quote:
Originally Posted by Equinox
I guess you mean to say you can't help with this matter
that is what I meant...
pornpf69 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-16-2005, 03:03 PM   #11
J.P.
Confirmed User
 
Join Date: Jun 2004
Posts: 689
psili, that code won't work, because .* matches everything 0 or more times and /? matches a character 0 times or once... so this code of yours would match
http://www.domain.com/category/postname.html also

Code:
RewriteEngine on
RewriteRule $categories/([^/\.]+)/?^ categories/$1.html [R=301]
this would match everything except for / and . 1 or more times, so http://www.domain.com/category/postname.html would not match...

This is not tested also, so maybe there are errors in this too

Note that the above code will work in .htacces only, to use it in httpd.conf you should add / right before the categories, like this:

Code:
RewriteEngine on
RewriteRule $/categories/([^/\.]+)/?^ /categories/$1.html [R=301]
Julio
__________________
Webmasters! Looking for new affiliate programs to promote?
Affiliate Program Search <-- Search for programs with FHGs, RSS feed, specific niche sponsors, ...
J.P. is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-16-2005, 03:24 PM   #12
jimmyf
OU812
 
Join Date: Feb 2001
Location: California
Posts: 12,651
Quote:
Originally Posted by The Sultan Of Smut

tamingthebeast.net

dam good one, explanes it the best I've ever seen.
__________________
Epic CashEpic Cash works for me
Solar Cash Paysite Plugin
Gallery of the day freesites,POTD,Gallery generator with free hosting
jimmyf is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-16-2005, 07:25 PM   #13
X37375787
Guest
 
Posts: n/a
thanks for the info guys. The example I posted was rather specific, the solution I need will be a little more complex since I am looking into redirecting URLs in different subfolders, not just /categories/. But nonetheless, I can start with the info that was posted here.
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-17-2005, 03:47 AM   #14
J.P.
Confirmed User
 
Join Date: Jun 2004
Posts: 689
Not a problem:

Code:
RewriteEngine on
RewriteRule $(dir1|dir2|dir3|dir4)/([^/\.]+)/?^ $1/$2.html [R=301]
Julio
__________________
Webmasters! Looking for new affiliate programs to promote?
Affiliate Program Search <-- Search for programs with FHGs, RSS feed, specific niche sponsors, ...
J.P. is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.