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 08-19-2012, 09:22 AM   #1
The Dawg
Confirmed User
 
The Dawg's Avatar
 
Join Date: Apr 2002
Location: State Of Bliss
Posts: 2,438
.htaccess help

Situation: Moved wordpress from /blog to root.

New setup has a new front end, but the old blog posts are now being directed to /blog/ (works fine).

Problem:

The indexed search engine pages for "search" (http://www.domain.com/blog/?s=widget) are now 404.


How can I use .htaccess to redirect /blog/?s=widget to domain.com/?s=widget


Thanks
The Dawg is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-19-2012, 10:11 AM   #2
kazymjir
Confirmed User
 
kazymjir's Avatar
 
Industry Role:
Join Date: Oct 2011
Location: Munich
Posts: 411
Not tested, but try something like:

Code:
RedirectMatch 301 ^/blog/(.*)$ http://www.domain.com/$1
__________________
http://kazymjir.com/
kazymjir is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-19-2012, 10:14 AM   #3
Colmike9
(>^_^)b
 
Colmike9's Avatar
 
Industry Role:
Join Date: Dec 2011
Posts: 7,223
What about a plugin like http://wordpress.org/extend/plugins/404-redirected/
__________________
Join the BEST cam affiliate program on the internet!
I've referred over $1.7mil in spending this past year, you should join in.
I make a lot more money in the medical field in a lab now, fuck you guys. Don't ask me to come back, but do join Chaturbate in my sig, it still makes bank without me touching shit for years..
Colmike9 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-19-2012, 10:55 AM   #4
The Dawg
Confirmed User
 
The Dawg's Avatar
 
Join Date: Apr 2002
Location: State Of Bliss
Posts: 2,438
Quote:
Originally Posted by kazymjir View Post
Not tested, but try something like:

Code:
RedirectMatch 301 ^/blog/(.*)$ http://www.domain.com/$1
I tried this one, but it was redirecting all /blog/ to root which conflicted with the blog portion of the site.

Quote:
Originally Posted by Colmike7 View Post
I am using another redirection plugin that does this also. I am using it to find all of the 404's. I think I'd rather do it through .htaccess (server side) vs. plugin as a long term solution.
The Dawg is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-19-2012, 12:36 PM   #5
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,372
Code:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^fris\.net [NC]
RewriteRule ^(.*)$ /$1 [L,R=301]
http://fris.net/blog/test.html redirects now to http://fris.net/test.html
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-19-2012, 12:52 PM   #6
AnniKN
Confirmed User
 
AnniKN's Avatar
 
Industry Role:
Join Date: Feb 2008
Location: South of the border
Posts: 1,682
This one is specifically for the search pages, rather than all things

Code:
RewriteEngine On
RewriteRule ^\?s\=([^/]*)$ /blog/?s=$1 [L]
hope it helps
AnniKN is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-19-2012, 01:27 PM   #7
Nookster
Confirmed IT Professional
 
Industry Role:
Join Date: Nov 2005
Location: Hollywood, CA
Posts: 3,744
Simply append [QSA] to your existing rule.

When all else fails, consult the source: http://httpd.apache.org/docs/current...d_rewrite.html

Last edited by Nookster; 08-19-2012 at 01:33 PM..
Nookster is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-19-2012, 07:12 PM   #8
garce
Confirmed User
 
garce's Avatar
 
Industry Role:
Join Date: Oct 2001
Location: Toronto
Posts: 7,103


Not much help, but when all else fails... Weird Al for GOD! He's got my vote...
garce is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-19-2012, 09:59 PM   #9
Nookster
Confirmed IT Professional
 
Industry Role:
Join Date: Nov 2005
Location: Hollywood, CA
Posts: 3,744
Quote:
Originally Posted by garce View Post


Not much help, but when all else fails... Weird Al for GOD! He's got my vote...
You're a moron and obviously didn't take anything into account. Typical CA.

Last edited by Nookster; 08-19-2012 at 10:00 PM..
Nookster 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.