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 06-19-2013, 03:02 AM   #1
v4 media
Confirmed User
 
v4 media's Avatar
 
Industry Role:
Join Date: Feb 2005
Location: Spain
Posts: 2,934
htaccess q.

Got a folder with loads of content called /subdirectory/blah/ want to leave the content in there but use htaccess to call it /anotherdirectory/blah/
so if people click a link for domain.com/subdirectory/blah/ they get the content for domain.com/subdirectory/blah/ but the newurl is domain.com/anotherdirectory/blah/



Does that make sense?

htaccess confuses the fuck out of me. Can never work out what can/cant be done.
I know if I moved the content I can do it with a 301, but if the content hasn´t moved, will it still work?

RewriteRule ^subdirectory/(.*)$ /anotherdirectory/$1 [R=301,NC,L]
v4 media is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-19-2013, 03:07 AM   #2
miXXXture
Confirmed User
 
miXXXture's Avatar
 
Industry Role:
Join Date: Jul 2009
Posts: 217

Last edited by miXXXture; 06-19-2013 at 03:09 AM.. Reason: never mind
miXXXture is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-19-2013, 03:15 AM   #3
v4 media
Confirmed User
 
v4 media's Avatar
 
Industry Role:
Join Date: Feb 2005
Location: Spain
Posts: 2,934
the redirect does the job, it shows the correct url, but the content doesnt show.

I get a 404 on the directory /new/ and Error 310 (net::ERR_TOO_MANY_REDIRECTS): on /new/blah/

The content on the server is still in /old/ I just want the url to show /new/ sort of like a slug rename in wp.

maybe I cant do it in htaccess without moving the content. its a custom wp post type, so a bit tricky.
v4 media is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-19-2013, 03:35 AM   #4
paffie
Confirmed User
 
Industry Role:
Join Date: Mar 2013
Posts: 116
i did something like this before on one of my blogs... but i cannot seem to find the htaccess file i used back then...

I suppose it's basically (got this from stackoverflow):
//begin code
RewriteCond %{REQUEST_URI} !^v2/
RewriteRule ^(.*)$ v2/$1 [L]
//end code

Basically, you have a condition when to rewrite, in this case: the url cannot end with v2/
In case the uri doesn't end with v2/, everything after the domain will be rewritten to the v2-directory...

in your case, it will be something like
//begin code
RewriteCond %{REQUEST_URI} ^firstdirectory/
RewriteRule ^(.*)$ seconddirectory/$1 [L]
//end code

I'm not an htaccess guru, try it out for yourself, and see if it works ;-)
paffie is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-19-2013, 03:53 AM   #5
v4 media
Confirmed User
 
v4 media's Avatar
 
Industry Role:
Join Date: Feb 2005
Location: Spain
Posts: 2,934
nope that doesn´t want to work either. thx for trying though.
I think I´m going to have to copy over all the posts, then set up a standard 301 just to take care of the existing links.
v4 media is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-19-2013, 04:39 AM   #6
woj
<&(©¿©)&>
 
woj's Avatar
 
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
you are probably missing something simple, icq me 33375924 and I'll work it out for a beer or 2...
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager
woj is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-19-2013, 05:20 AM   #7
v4 media
Confirmed User
 
v4 media's Avatar
 
Industry Role:
Join Date: Feb 2005
Location: Spain
Posts: 2,934
Quote:
Originally Posted by woj View Post
you are probably missing something simple, icq me 33375924 and I'll work it out for a beer or 2...
I just bulk changed the custom post type, and set up a 301 and that did the job.
Thougth the changing post types was going to be a pain but found a plugin that did it.
thanks for the offer though.
v4 media is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-19-2013, 05:44 AM   #8
Stephen
Consigliere
 
Industry Role:
Join Date: Feb 2003
Posts: 1,771
Quote:
Originally Posted by v4 media View Post
I just bulk changed the custom post type ... found a plugin
This problem is likely caused by using WordPress, which has its own internal rewrite tables in addition to the htaccess it uses.

Plugins can add an extra layer of redirects. Put it on a virtual host and you can have even more rewrites and server-crushing loops.

It's the internal rewrites that cause a lot of headaches for those that don't know they're there
Stephen is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-19-2013, 05:51 AM   #9
v4 media
Confirmed User
 
v4 media's Avatar
 
Industry Role:
Join Date: Feb 2005
Location: Spain
Posts: 2,934
Quote:
Originally Posted by Stephen View Post
This problem is likely caused by using WordPress, which has its own internal rewrite tables in addition to the htaccess it uses.

Plugins can add an extra layer of redirects. Put it on a virtual host and you can have even more rewrites and server-crushing loops.

It's the internal rewrites that cause a lot of headaches for those that don't know they're there
I turned the plugin off after it moved everything. It was just to get everything moved over.
v4 media 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.