View Full Version : Htaccess Problem
round
08-07-2013, 09:22 AM
When i upload this code to my website, it Gives me 500 Internal Server error.
Can anyone help me to solve it. ?
Is it the Problem of any of the Apache service ?
Thanks in Advance for Any help.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /mysite/
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
Beverleyh
08-07-2013, 11:01 AM
What if you just try;
RewriteEngine On
RewriteBase /mysite/
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
djr33
08-07-2013, 11:03 AM
Mod rewrite is always tricky. 500 errors come up whenever there is a bug in the code. I don't see any obvious problem just looking at it (not that I'm great at reading these-- I find them to be confusing), but I'd bet there is a typo or something that doesn't line up with your system. For example, there might end up being an endless loop somehow. When debugging these I usually just try a lot of combinations and hope that something works. One issue can be the [L] rules that make it stop-- maybe they're not being properly activated. Note that once in a while the server can get "stuck" so you have to wait before trying again. Be careful when using .htaccess-- it can really mess things up (although deleting the .htaccess file via FTP will almost always restore it).
Maybe someone else will be able to see the problem.
Have you tried writing out an explanation in plain English for each line to be sure that it matches the files on your server?
Edit: Beverley and I cross-posted. I agree with her that you might want to try a simpler version. I've never needed to use those extra commands, but your server could require them.
Goshawk
08-29-2013, 12:10 PM
Have you updated your path parameters in your config files on your website?
On some hosts this will point your main domain name to your /mysite/ folder, but your url would still read www.mydomain.com/mysite/index.php
In other words, if you type the url www.mydomain.com, the browser will be directed to www.mydomain.com/mysite/index.php
Not all web host allow the redirection of your main domain to a folder.
A way around this is to add an additional domain name to your account, and make that the main account domain.
Then set the domain that you would like to use for your website as an add-on domain.
Add-on domains are usually allowed to be pointed directly to a folder on your site.
This would mean that when you set your add-on domain to start in /mysite/ folder, and you would not have to fiddle with the htaccess file at all.
So this way when you type the url www.add-on-domain.com, automatically it will be started in /mysite/ folder, and the url in the browser will read www.add-on-domain.com/index.php
You can than use htaccess to redirect your mydomain.com to add-on-domain.com
Hope this helps
Goshawk
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.