Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Reply
All.htaccess attempts failed for my blog
Old 01-30-2010, 01:46 AM All.htaccess attempts failed for my blog
Novice Talker

Posts: 7
Trades: 0
Hello friends,
i tried to make aredirect of my blog http://www.neophytech.com/blog/ to http://www.webdesigncut.com/blog/ with cpanel but failed done this succesfully with other pages

already tried

RewriteEngine on
RewriteCond %{HTTP_HOST} ^blog.neophytech.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.blog.neophytech.com$
RewriteRule ^/?$ "http\:\/\/www\.webdesigncut\.com\/blog\/" [R=301,L]

RewriteCond %{HTTP_HOST} ^neophytech.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.neophytech.com$
RewriteRule ^blog\/?$ "http\:\/\/www\.webdesigncut\.com\/blog\/" [R=301,L]

RewriteEngine on
RewriteCond %{HTTP_HOST} ^blog.neophytech.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.blog.neophytech.com$
RewriteRule ^/?$ "http\:\/\/www\.webdesigncut\.com\/blog\/" [R=301,L]

Try this rule
RewriteCond %{HTTP_HOST} ^www\.neophytech\.com\/blog$
RewriteRule ^/?$ "http\:\/\/www\.webdesigncut\.com\/blog\/" [R=301,L]

RewriteCond %{HTTP_HOST} ^www.neophytech.com/blog$
RewriteRule ^/?$ "http\:\/\/www\.webdesigncut\.com\/blog\/" [R=301,L]

none wrked
__________________

Please login or register to view this content. Registration is FREE
sash_007 is offline
Reply With Quote
View Public Profile Visit sash_007's homepage!
 
 
Register now for full access!
Old 02-02-2010, 02:19 PM Re: All.htaccess attempts failed for my blog
L a r r y's Avatar
Super Talker

Posts: 103
Name: Larry K
Location: Arizona
Trades: 0
I just tried both of your sites and Firefox is loading and loading, waiting for the site. Eventually, a database error came up for www.webdesigncut.com/blog/. Page reads,
Error establishing a database connection

Edit: On the first attempt I clicked on the neopytech link first and webdesigncut second.

I shut the browser and came back to this thread and clicked the links in reverse order.

On the first attempt Firefox reported it can't find www.neophytech.com, and waited endlessly for the webdesigncut server to load. Second time around it finally landed on the database error page for webdesigncut but endlessly waited for neophytech.com server. It's curious that I get endless waiting on the second link in each case and an end result for the first link both times. /Edit


Meanwhile, in a third tab I opened a site I haven't been to in recent memory, alltheweb.com, and it came straight up.

I have used instead of the RewriteCond and RewriteRule approach, Redirect Permanent for an entire branch of the tree, or RedirectMatch Permanent for a specific URL for when I am moving a page from one place to another on the same or a different site.

Last edited by L a r r y; 02-02-2010 at 02:35 PM..
L a r r y is offline
Reply With Quote
View Public Profile Visit L a r r y's homepage!
 
Old 02-02-2010, 02:48 PM Re: All.htaccess attempts failed for my blog
L a r r y's Avatar
Super Talker

Posts: 103
Name: Larry K
Location: Arizona
Trades: 0
I'm looking at this tutorial over here and it is showing a RewriteRule without the backslashes. Try http:// instead of http\:\/\/.
L a r r y is offline
Reply With Quote
View Public Profile Visit L a r r y's homepage!
 
Old 02-03-2010, 02:45 AM Re: All.htaccess attempts failed for my blog
Novice Talker

Posts: 7
Trades: 0
Quote:
Originally Posted by L a r r y View Post
I just tried both of your sites and Firefox is loading and loading, waiting for the site. Eventually, a database error came up for www.webdesigncut.com/blog/. Page reads,
Error establishing a database connection

Edit: On the first attempt I clicked on the neopytech link first and webdesigncut second.

I shut the browser and came back to this thread and clicked the links in reverse order.

On the first attempt Firefox reported it can't find www.neophytech.com, and waited endlessly for the webdesigncut server to load. Second time around it finally landed on the database error page for webdesigncut but endlessly waited for neophytech.com server. It's curious that I get endless waiting on the second link in each case and an end result for the first link both times. /Edit


Meanwhile, in a third tab I opened a site I haven't been to in recent memory, alltheweb.com, and it came straight up.

I have used instead of the RewriteCond and RewriteRule approach, Redirect Permanent for an entire branch of the tree, or RedirectMatch Permanent for a specific URL for when I am moving a page from one place to another on the same or a different site.
tried this with no result
RewriteCond %{HTTP_HOST} ^www.neophytech.com/blog$
RewriteRule ^/?$ "http://www\.webdesigncut\.com\/blog\/" [R=301,L]



RewriteRule blog/www.neophytech.com http://www.webdesigncut.com/blog/
__________________

Please login or register to view this content. Registration is FREE
sash_007 is offline
Reply With Quote
View Public Profile Visit sash_007's homepage!
 
Old 02-10-2010, 05:01 AM Re: All.htaccess attempts failed for my blog
L a r r y's Avatar
Super Talker

Posts: 103
Name: Larry K
Location: Arizona
Trades: 0
Try this: On www.neophytech.com/, add
Code:
RedirectMatch Permanent ^blog(/)$ http://www.webdesigncut.com/blog/
EDIT: Let's try that again: (That ^^ didn't work)
Code:
RedirectMatch Permanent ^/blog(/)$ http://www.webdesigncut.com/blog/
I needed the leading slash in front of blog.

I placed this code on my site, which has no /blog/ directory, and when I visited ....org/blog/ I was sent to your site.

Now supposedly placing a slash in parentheses as in (/) in there is supposed to optionally transfer a url with or without an ending slash but I found that ....org/blog went to my 404 page, whereas ....org/blog/ went to your blog.

OK then, so I take out the (/) and have the first argument read ^/blog$ Now ....org/blog goes to your site but ....org/blog/ gets my 404.

So it looks like, since (/) isn't working today, I am left with:
Code:
RedirectMatch Permanent ^/blog$ http://www.webdesigncut.com/blog/
RedirectMatch Permanent ^/blog/$ http://www.webdesigncut.com/blog/
in order to get a redirect for both with and without trailing slash.

Tested it and it works.
/EDIT

Last edited by L a r r y; 02-10-2010 at 05:46 AM..
L a r r y is offline
Reply With Quote
View Public Profile Visit L a r r y's homepage!
 
Old 02-25-2010, 07:49 PM Re: All.htaccess attempts failed for my blog
L a r r y's Avatar
Super Talker

Posts: 103
Name: Larry K
Location: Arizona
Trades: 0
Quote:
Originally Posted by L a r r y View Post
Try this: On www.neophytech.com/, add
Code:
RedirectMatch Permanent ^blog(/)$ http://www.webdesigncut.com/blog/
EDIT: Let's try that again: (That ^^ didn't work)
...
/EDIT
That didn't work because I failed to place a question mark after the (/) and before the $. With RedirectMatch, I also have to place a leading slash after the caret.

Code:
RedirectMatch Permanent ^/blog(/)?$ http://www.webdesigncut.com/blog/
That reads as "Match the string beginning with /blog and ending with zero or one instances of what is found in the parentheses."

The caret ^ marks the beginning of the string to match, the $ marks the end of the string to match, and the Question Mark means 0 or 1 of what was just before it. The parentheses simply sets the boundary on the string the Question Mark applies to, in this case the / character.

I tested it in my .htaccess and it works.

I will investigate the use of RewriteRules to achieve this goal and see if I can determine what went wrong with the OP's original efforts and post again in this thread with those results.
L a r r y is offline
Reply With Quote
View Public Profile Visit L a r r y's homepage!
 
Old 02-25-2010, 09:03 PM Re: All.htaccess attempts failed for my blog
L a r r y's Avatar
Super Talker

Posts: 103
Name: Larry K
Location: Arizona
Trades: 0
Quote:
Originally Posted by L a r r y View Post


Code:
RedirectMatch Permanent ^/blog(/)?$ http://www.webdesigncut.com/blog/
I will investigate the use of RewriteRules to achieve this goal and see if I can determine what went wrong with the OP's original efforts and post again in this thread with those results.
I found this RewriteRule accomplishes the same thing as my RedirectMatch:

Code:
RewriteRule ^blog(/)?$ http://www.webdesigncut.com/blog/ [R=302,L]
I tested it in my website's root .htaccess, and it goes to the OP's webdesigncut blog. I can enter (mydomain)/blog or (mydomain/blog/ and it sends me to the websesigncut page.

As written I used code 302 for a temporary redirect as opposed to the 301 code, which would make the redirect permanent.

I did not specify any RewriteCond conditions ahead of my Rule.

The RewriteRule does not require the leading slash as does the RedirectMatch option that I laid out in my earlier post.

Going back to the original post, of the several attempts listed, the RewriteRule was drawn up in error in each case, because the right side argument of the RewriteRule is a straightforward URL as it should appear in the browser's address field, starting with http:// and ending with /blog/ There is no use of regex in the output URL, therefore no need for escaping with the backslash (the \ character).

In reviewing the thread, I gave some advice to check "this" tutorial "over here" and suggested using http:// instead, but I should have advised to not use any backslashes. OP responded with a RewriteRule that still contained backslashes, and it therefore failed. I was not as complete with my advice and my depth of understanding of the subject was lacking.

I hope this post helps clarify the problem, and I will see if I can contact the OP through his site if he does not respond here or fix the problem with the two sites linked in his first post.
L a r r y is offline
Reply With Quote
View Public Profile Visit L a r r y's homepage!
 
Reply     « Reply to All.htaccess attempts failed for my blog
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.28448 seconds with 12 queries