GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   any htacces expert ? (https://gfy.com/showthread.php?t=1126266)

MKA 11-16-2013 06:05 AM

any htacces expert ?
 
Can anyone please do me a favour.
Been looking to fix this for days. Fixed most of the htaccess rules i needed but one last one left.

I've changed a lot on my site and old urls are not valid anymore. I can't redirect them to the new script because it does not have old content anymore.

I need this.

http://www.mydomain/entry/19907/i-fucking-love-gfy

with a permanent 301 redirect to

http://old.mydomain/entry/19907/i-fucking-love-gfy


anyone with the solution will be my online hero forever!

freecartoonporn 11-16-2013 06:14 AM

try this

//301 Redirect Entire Directory
RedirectMatch 301 old(.*) www/$1

ref: http://www.htaccessredirect.net/index.php

MKA 11-16-2013 06:56 AM

That made the site crash to be honest :)
But thanks to that site i got pointed into the right direction and so far i did this

RedirectMatch 301 /entry/(.*)/ http://old.mydomain.com/entry/$1

Eventually this is the url that you enter: http://old.mydomain.com/entry/2190
Still missing the txt AFTER the video id (in this case 2190)

Barry-xlovecam 11-16-2013 07:13 AM

http://www.askapache.com/htaccess/ht...-rewrites.html

freecartoonporn 11-16-2013 07:18 AM

Quote:

Originally Posted by MKA (Post 19875015)
That made the site crash to be honest :)
But thanks to that site i got pointed into the right direction and so far i did this

RedirectMatch 301 /entry/(.*)/ http://old.mydomain.com/entry/$1

Eventually this is the url that you enter: http://old.mydomain.com/entry/2190
Still missing the txt AFTER the video id (in this case 2190)

sorry my bad.,

it was meant for directories and not for subdomains.

so you want www to go to old

//Rewrite to www
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.mydomain.com[nc]
RewriteRule ^(.*)$ http://old.mydomain.com/$1 [r=301,nc]

################################################

so you want old to go to www

//Rewrite to www
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^old.mydomain.com[nc]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [r=301,nc]


you can add QSA too at the end.


All times are GMT -7. The time now is 06:04 AM.

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