GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Webmaster Q & Fuckin' A (https://gfy.com/forumdisplay.php?f=27)
-   -   .htaccess and 301 Redirect (https://gfy.com/showthread.php?t=1132368)

Moren 01-31-2014 01:07 PM

.htaccess and 301 Redirect
 
Hi
I try to do some redirection, I want to redirect all blog post from my sub-domain ( but not from main sub-domain page) to my domain category page.

sub.domain.com/all-post/ to domain.com/category/

(or even better to domain.com/category/random-post/ - but I don't believe that is possible... )

And I want to keep the main page of my sub-domain.

Thanks!

PornCious 02-01-2014 12:11 AM

did you try this www htaccessredirect dot net

Moren 02-01-2014 05:56 AM

I do not get what I need...

PornCious 02-03-2014 08:11 PM

Following is the basic redirection. However, looks like you need multiple filtration which should not be impossible...
Code:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^sub.yourdomain.com$
RewriteRule ^(.*)$ http://yourdomain.com/$1 [R=301,L]

Try asking an apache expect in stackexchange or stackoverflow.

You will need one adddition line like RewriteCond %{REQUEST_URI} before rewrite rule.

David-PD 02-04-2014 12:15 AM

If u want to redirect to random post u need to use php or any other lang ur using.

Barry-xlovecam 02-10-2014 09:40 PM

Code:

301 Redirect Entire Directory ^

RedirectMatch 301 /blog(.*) http://www.askapache.com/$1

try out in that sub domain's .htaccess
Code:

RedirectMatch 301 /all-post(.*)  http://domain.com/category/$1
http://www.askapache.com/htaccess/htaccess.html if the above won't work read the code posts here.

Moren 02-14-2014 11:30 AM

I buy on fiverr for 5$ this htaccess code, and it is working for me:

Code:

RewriteCond %{HTTP_HOST} ^boobs\.domain\.c o m [NC]
RewriteCond %{REQUEST_URI} ^/([0-9]{4})/([0-9]{2})/([^/]+)/$
RewriteRule (.+) h t t p://domain.c o m/category/boobs-busty/ [R=301,L]


PornCious 02-15-2014 12:07 AM

Quote:

Originally Posted by Moren (Post 19982892)
I buy on fiverr for 5$ this htaccess code, and it is working for me:

Code:

RewriteCond %{HTTP_HOST} ^boobs\.domain\.c o m [NC]
RewriteCond %{REQUEST_URI} ^/([0-9]{4})/([0-9]{2})/([^/]+)/$
RewriteRule (.+) h t t p://domain.c o m/category/boobs-busty/ [R=301,L]



i knew about REQUEST_URI but couldn't figure it out. lol thanks for sharing with us! it might save 5 bucks for many.


All times are GMT -7. The time now is 03:26 PM.

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