|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
So this is the code and it is not working:
RewriteEngine On RewriteCond %{HTTP_HOST} ^http://surf-bodyboard.effisk.net/ind...3/15/1-acheter RewriteRule (.*) http://www.surf-blog.net/?2005/03/15/1-acheter/$1 [R=301,L] ? I would also try posting here: http://www.webmasterworld.com/forum92/page116.htm |
|
|||
|
I don't know why you are using a re-write condition. A simple re-direction should work.
Code:
Permanent 301 / http://www.newdomain.com Web Hosting | Webmaster Help |
|
||||
|
Hi.
Quote:
sub.domain.com and newdomain.com are the same site. hosted at the same place. newdomain.com/index.php is not a copy of sub.domain.com/index.php, it is the same page. because of the above reason, your suggestion won't work. It will create a loop and end up telling the visitor that the maximum redirection limit has been hit and the page won't be served. |
|
|||
|
What about adding something like the quick, dirty, and unrefined code below to index.php:
<? $hostname =getenv('HTTP_HOST'); $page= getenv("REQUEST_URI"); $new_destination="http://yournewdomain".$page; if (stristr($hostname,"yoursubdomain")){ header("HTTP/1.1 301 Moved Permanently"); header("Location: $new_destination"); exit(); } ?>
__________________
Hardcore Programming Solutions and Coffee Drinker |
|
||||
|
Quote:
I don't get it. |
|
|||
|
Here is a working sample:
Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^toolbarn.*
RewriteRule ^(.*) http://www.toolbarn.com/$1 [R=301,L]
Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^subdomain.*
RewriteRule ^(.*) http://www.newdomain.com/$1 [R=301,L]
Brian.
__________________
ToolBarn.com, an Internet Retailer Top 500 and Inc. 500 Company | Tool Parts | Pet Supplies |
|
|||
|
Do you have any other lines in the .htaccess file before these? These should be the first lines of your file for them to work properly.
If you'd like me to really dig, pm me for an email address that you can send login info to. You can delete / change the login when I'm done. I'm just really curious and would love to see it work right. Brian.
__________________
ToolBarn.com, an Internet Retailer Top 500 and Inc. 500 Company | Tool Parts | Pet Supplies |
|
||||
|
Quote:
RewriteEngine On RewriteCond %{HTTP_HOST} sub\.domain\.com(:[0-9]{1,5})?$ [NC] RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=permanent,L] # Hotlink control SetEnvIfNoCase Referer "^http://sub.domain.com" local_referal SetEnvIfNoCase Referer "^http://www.newdomain.com" local_referal SetEnvIfNoCase Referer "^http://www.other-domain.net" local_referal SetEnvIfNoCase Referer "^$" local_referal <FilesMatch "\.(gif|jpe?g|png)$"> Order Deny,Allow Deny From All Allow from env=local_referal </FilesMatch> errordocument 403 /403.html errordocument 404 /404.html I also tried to only leave the RewriteEngine rules and remove the rest, no difference. Quote:
I'm not sure I can grant you access to my ftp. I have limited rights to this account. |
|
|||
|
Well... if I'm reading this part right
Code:
sub\.domain\.com(:[0-9]{1,5})?$
Brian.
__________________
ToolBarn.com, an Internet Retailer Top 500 and Inc. 500 Company | Tool Parts | Pet Supplies |
|
||||
|
If I remove the ? it doesn't redirect any page anymore.
RewriteEngine On RewriteCond %{HTTP_HOST} sub\.domain\.com$ [NC] RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=permanent,L] has the same effect as what I currently have. |
|
|||
|
Have you considered redirecting index.php to / at all? That could solve the problem here as well as avoid duplicate content in the search engine indexes. Otherwise, I'm totally drawing a blank.
Brian.
__________________
ToolBarn.com, an Internet Retailer Top 500 and Inc. 500 Company | Tool Parts | Pet Supplies |
|
||||
|
Quote:
thanks for the time you spend on this. |
|
|||
|
Try it to the same domain.
Code:
redirect 301 /index.php http://subdomain.olddomain.com/ Code:
RewriteEngine On RewriteRule ^index.php(.+)$ http://subdomain.olddomain.com/$1 Brian.
__________________
ToolBarn.com, an Internet Retailer Top 500 and Inc. 500 Company | Tool Parts | Pet Supplies |
|
||||
|
I tried both, first along with the rest of my code, then on its own in the .htaccess.
Same results as before. There must be some other parameter that has an impact outside of this htaccess file, but what, and why? I've cleaned up the web from links to pages with index.php, I guess I'll just wait till SE stop indexing these pages and I'll leave the htaccess as is. I wrote to my provider about this problem, I'll keep you posted if I have a reply. This is very weird but I'm sure it's something simple that we haven't thought of. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |