![]() |
![]() |
![]() |
||||
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. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Feb 2005
Location: Spain
Posts: 2,934
|
![]() 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] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Jul 2009
Posts: 217
|
![]() ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
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 ;-) |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
<&(©¿©)&>
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
Confirmed User
Industry Role:
Join Date: Feb 2005
Location: Spain
Posts: 2,934
|
Quote:
Thougth the changing post types was going to be a pain but found a plugin that did it. thanks for the offer though. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Consigliere
Industry Role:
Join Date: Feb 2003
Posts: 1,771
|
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 ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
Confirmed User
Industry Role:
Join Date: Feb 2005
Location: Spain
Posts: 2,934
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |