Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
February 09, 2012, 05:56:09 PM

Pages: [1]   Go Down
  Print  
Author Topic: i need help with .htaccess  (Read 1158 times)
xtint
Newbie
*
Offline Offline

Posts: 3


« on: November 02, 2009, 06:44:08 AM »

I have tried writing a .htaccess to direct to a specific joomla installation for my website but i keep getting 500 internal error.what could be the problem.below is my code

RewriteEngine On
Options +FollowSymlinks

RewriteCond %{HTTP_HOST} name of my website $
RewriteCond %{REQUEST_URI} !subdirectory/
RewriteRule ^(.*)$ subdirectory/$1

Thanks
Jerry
Logged
MrPhil
Berserker Poster
*****
Offline Offline

Posts: 5083



« Reply #1 on: November 02, 2009, 07:12:16 AM »

Do you not get the 500 error if you comment out (#) the three Rewrite... lines?  If true, that isolates the problem to those lines. You'll have to show more clearly what your code looks like, so we can see if you have an error in it. I.e., name of my website $ is useless, while ^mydomain\.com would be helpful.

Code:
RewriteCond %{HTTP_HOST} ^(www\.)?mydomain\.com
RewriteCond %{REQUEST_URI} !^subdir/
RewriteRule ^(.*)$ subdir/$1 [L]

Is it definitely the .htaccess file that's causing the problem, or are you being successfully redirected and the problem is a bad PHP file?
Logged

xtint
Newbie
*
Offline Offline

Posts: 3


« Reply #2 on: November 02, 2009, 07:35:43 AM »

I think it the .htaccess with the problem since it does not redirect at all.The code am using is below

RewriteEngine On
Options +FollowSymlinks

RewriteCond %{HTTP_HOST} domainname $
RewriteCond %{REQUEST_URI} !subdirectory/
RewriteRule ^(.*)$ subdirectory/$1
Logged
MrPhil
Berserker Poster
*****
Offline Offline

Posts: 5083



« Reply #3 on: November 02, 2009, 03:32:51 PM »

Your first RewriteCond is bad. Change to

Code:
RewriteCond %{HTTP_HOST} ^domainname
RewriteCond %{REQUEST_URI} !^subdirectory/
RewriteRule ^(.*)$ subdirectory/$1
Logged

xtint
Newbie
*
Offline Offline

Posts: 3


« Reply #4 on: November 05, 2009, 06:55:31 AM »

I have followed all the instructions the previous members gave me but i still can't get the .htaccess working.it still throws me a 500 internal server error.what should i do next
Logged
Mitch
Berserker Poster
*****
Offline Offline

Posts: 12838


WWW
« Reply #5 on: November 05, 2009, 07:23:48 AM »

Do you have any other redirection code in your .htaccess file that might be "fighting" with the code snipit that MrPhil gave you?
Logged

New to Web Site Hosting? Check Out the Lunarpages Blog Hosting Guide!


Follow us @lunarpages on Twitter!
Important Threads: Read This Before Posting! | Lunarforums Rules! | Mitch's Link of the Day!
Also, be sure to check out and subscribe to the Lunartics Blog and the Lunarpages Newsletter !

Need Web Hosting Help? Check out the Lunarpages Web Hosting Wiki. It has tons of tips, tutorials and resources!
darkwolf
Guest
« Reply #6 on: December 01, 2009, 03:42:19 AM »

A good test to try:

1. Remove the redirect code.
2. See if the joomla install is accessible via domainname.com/joomlainstallfolder/

If you still get the error, then the issue is not the redirect code.

Logged
Pages: [1]   Go Up
  Print  
 
Jump to: