NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page .htaccess redirect

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 06-11-2007, 10:12 AM THREAD STARTER               #1 (permalink)
NamePros Regular
 
Maurizio1230's Avatar
Join Date: Jan 2007
Posts: 447
Maurizio1230 is on a distinguished road
 



.htaccess redirect


Hi all,

I try to make a redirection in Redirects Section on Cpanel 11 from linuxinvent.info to linuxinvent.info/home/modules/news but i received this error:

Quote:
Redirecting / to http://linuxinvent.info/home/modules/news will cause a redirection loop because '/'
????: NamePros.com http://www.namepros.com/programming/337956-htaccess-redirect.html

which is located at /home/linuxinvent/public_html/

is above 'http://linuxinvent/linux/modules/news'

which is located at /home/linuxinvent/public_html/linux/modules/news
On cpanel.net I see that is a bug on cpanel 11.
How can I make a personal .htaccess for redirecting from linuxinvent.info to linuxinvent.info/linux/modules/news?

Thank you very much
Bye Maurizio1230
Maurizio1230 is offline  
Old 06-11-2007, 10:34 AM   #2 (permalink)
NamePros Regular
 
monaco's Avatar
Join Date: Jul 2005
Location: Tucson, AZ
Posts: 689
monaco will become famous soon enough
 



RewriteEngine On
RewriteCond ^(https?:\/\/(www\.)?)?linuxinvent.info$
RewriteRule http://linuxinvent.info/linux/modules/news [R]

Something like that...I wrote that off the top of my head and didn't test it...but you want to use mod_rewrite for this.
__________________
My Website | My Blog
monaco is offline  
Old 06-11-2007, 10:37 AM THREAD STARTER               #3 (permalink)
NamePros Regular
 
Maurizio1230's Avatar
Join Date: Jan 2007
Posts: 447
Maurizio1230 is on a distinguished road
 



Originally Posted by monaco
RewriteEngine On
????: NamePros.com http://www.namepros.com/showthread.php?t=337956
RewriteCond ^(https?:\/\/(www\.)?)?linuxinvent.info$
RewriteRule http://linuxinvent.info/linux/modules/news [R]

Something like that...I wrote that off the top of my head and didn't test it...but you want to use mod_rewrite for this.
Hi monaco,

why https?

Thanks for the reply
Maurizio1230 is offline  
Old 06-11-2007, 10:44 AM   #4 (permalink)
NamePros Regular
 
monaco's Avatar
Join Date: Jul 2005
Location: Tucson, AZ
Posts: 689
monaco will become famous soon enough
 



Sorry, force of habit The question mark will make it match http or https.

It can be ^(http:\/\/(www\.)?)?linuxinvent.info$ if you're sure you're never going to use SSL on the site.
__________________
My Website | My Blog
monaco is offline  
Old 06-11-2007, 10:58 AM THREAD STARTER               #5 (permalink)
NamePros Regular
 
Maurizio1230's Avatar
Join Date: Jan 2007
Posts: 447
Maurizio1230 is on a distinguished road
 



I see this:

Quote:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@linuxinvent.info and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
Apache/1.3.37 Server at www.linuxinvent.info Port 80
I created a file .htacce and I wrote in this:
????: NamePros.com http://www.namepros.com/showthread.php?t=337956

Quote:
RewriteEngine On
RewriteCond ^(http?:\/\/(www\.)?)?linuxinvent.info$
RewriteRule http://linuxinvent.info/linux/modules/news [R]
How can I edit it for right redirection?

Thanks
Maurizio1230 is offline  
Old 06-11-2007, 11:05 AM   #6 (permalink)
NamePros Regular
 
monaco's Avatar
Join Date: Jul 2005
Location: Tucson, AZ
Posts: 689
monaco will become famous soon enough
 



What's it say in the error log? You can get to it via cPanel.
__________________
My Website | My Blog
monaco is offline  
Old 06-11-2007, 11:19 AM THREAD STARTER               #7 (permalink)
NamePros Regular
 
Maurizio1230's Avatar
Join Date: Jan 2007
Posts: 447
Maurizio1230 is on a distinguished road
 



here you are

Quote:
[Mon Jun 11 21:08:13 2007] [alert] [client 65.55.213.110] /home/linuxinv/public_html/.htaccess: RewriteCond: bad argument line '^(http?:\\/\\/(www\\.)?)?linuxinvent.info$'\n
[Mon Jun 11 21:08:13 2007] [alert] [client 65.55.213.110] /home/linuxinv/public_html/.htaccess: RewriteCond: bad argument line '^(http?:\\/\\/(www\\.)?)?linuxinvent.info$'\n
[Mon Jun 11 21:04:27 2007] [alert] [client 66.249.72.177] /home/linuxinv/public_html/.htaccess: RewriteCond: bad argument line '^(http?:\\/\\/(www\\.)?)?linuxinvent.info$'\n
[Mon Jun 11 21:04:27 2007] [alert] [client 66.249.72.177] /home/linuxinv/public_html/.htaccess: RewriteCond: bad argument line '^(http?:\\/\\/(www\\.)?)?linuxinvent.info$'\n
[Mon Jun 11 21:03:12 2007] [alert] [client 65.55.213.110] /home/linuxinv/public_html/.htaccess: RewriteCond: bad argument line '^(http?:\\/\\/(www\\.)?)?linuxinvent.info$'\n
[Mon Jun 11 21:03:12 2007] [alert] [client 65.55.213.110] /home/linuxinv/public_html/.htaccess: RewriteCond: bad argument line '^(http?:\\/\\/(www\\.)?)?linuxinvent.info$'\n
[Mon Jun 11 20:51:52 2007] [alert] [client 87.19.14.45] /home/linuxinv/public_html/.htaccess: RewriteCond: bad argument line '^(http?:\\/\\/(www\\.)?)?linuxinvent.info$'\n
[Mon Jun 11 20:51:52 2007] [alert] [client 87.19.14.45] /home/linuxinv/public_html/.htaccess: RewriteCond: bad argument line '^(http?:\\/\\/(www\\.)?)?linuxinvent.info$'\n
[Mon Jun 11 20:50:42 2007] [alert] [client 87.19.14.45] /home/linuxinv/public_html/.htaccess: RewriteCond: bad argument line '^(http?:\\/\\/(www\\.)?)?linuxinvent.info$'\n
????: NamePros.com http://www.namepros.com/showthread.php?t=337956
[Mon Jun 11 20:50:42 2007] [alert] [client 87.19.14.45] /home/linuxinv/public_html/.htaccess: RewriteCond: bad argument line '^(http?:\\/\\/(www\\.)?)?linuxinvent.info$'\n
[Mon Jun 11 20:50:38 2007] [alert] [client 87.19.14.45] /home/linuxinv/public_html/.htaccess: RewriteCond: bad argument line '^(http?:\\/\\/(www\\.)?)?linuxinvent.info$'\n
[Mon Jun 11 20:50:38 2007] [alert] [client 87.19.14.45] /home/linuxinv/public_html/.htaccess: RewriteCond: bad argument line '^(http?:\\/\\/(www\\.)?)?linuxinvent.info$'\n
Maurizio1230 is offline  
Old 06-11-2007, 12:23 PM   #8 (permalink)
NamePros Regular
 
monaco's Avatar
Join Date: Jul 2005
Location: Tucson, AZ
Posts: 689
monaco will become famous soon enough
 



Try
Code:
RewriteCond ${REQUEST_URI} ^(http?:\/\/(www\.)?)?linuxinvent.info$
__________________
My Website | My Blog
monaco is offline  
Old 06-11-2007, 12:53 PM THREAD STARTER               #9 (permalink)
NamePros Regular
 
Maurizio1230's Avatar
Join Date: Jan 2007
Posts: 447
Maurizio1230 is on a distinguished road
 



but now it doesn't redirect me. I see the "Index of"

Bye Maurizio1230
Maurizio1230 is offline  
Old 06-11-2007, 01:30 PM   #10 (permalink)
NamePros Regular
 
monaco's Avatar
Join Date: Jul 2005
Location: Tucson, AZ
Posts: 689
monaco will become famous soon enough
 



Do you see the index of the directory you want to redirect to or the index of the / directory?

Try changing the rewrite rule:
Code:
RewriteRule http://linuxinvent.info/linux/modules/news [R]
to
RewriteRule http://linuxinvent.info/linux/modules/news/index.php [R]
Use whatever you use as your index page.
__________________
My Website | My Blog
monaco is offline  
Old 06-13-2007, 12:10 AM THREAD STARTER               #11 (permalink)
NamePros Regular
 
Maurizio1230's Avatar
Join Date: Jan 2007
Posts: 447
Maurizio1230 is on a distinguished road
 



Hi monaco,

I resolve the problem because now the cpanel 11 bug was resolved by my hosting.
Thank you very much monaco

P.S. I add a reputation to you
Maurizio1230 is offline  
Old 06-13-2007, 09:01 AM   #12 (permalink)
NamePros Regular
 
monaco's Avatar
Join Date: Jul 2005
Location: Tucson, AZ
Posts: 689
monaco will become famous soon enough
 



Glad to hear ya got it fixed; sorry I couldn't be of more help.
__________________
My Website | My Blog
monaco is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


 
All times are GMT -7. The time now is 02:22 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger