InMotion Hosting Support Center

htaccess is not resolving correctly

2012-10-13 2:40 pm EST

Hits: 1,013
I have installed OJS in a subfolder.Its called "journals".I need to remove this /journals from url.I am having below .htaccess in my root folder(/).Its working fine in my localhost(XAMPP).But not working here in inmotion.Please have a look.

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/journals
RewriteRule ^index\.php(.*)$ /journals/index.php$1 [L]


* Are you getting any error messages?
* When did the issue begin occurring and how can we replicate it?
* What software are you using to build your site? seeing some 406.shtml
[Sat Oct 13 16:26:59 2012] [error] [client] File does not exist: /home/bmsnfc5/public_html/406.shtml, referer:

2.after putting htaccess in root folder.
just go to
this htaccess should make it but its not happening.

You must login before you can ask a follow up question.

You must login before you can submit an answer.



9,968 Points
2012-10-15 9:37 am EST
Hello Sunder, and thanks for the question.

It looks like your requests were triggering a (mod_security) rule:

[Mon Oct 15 08:49:46 2012] [error] [client] ModSecurity: Access denied with code 406 (phase 2). Pattern match "(?:\\\\b(?:(?:type\\\\b\\\\W*?\\\\b(?:text\\\\b\\\\W*?\\\\b(?:j(?:ava)?|ecma|vb)|application\\\\b\\\\W*?\\\\bx-(?:java|vb))script|c(?:opyparentfolder|reatetextrange)|get(?:special|parent)folder|iframe\\\\b.{0,100}?\\\\bsrc)\\\\b|on(?:(?:mo(?:use(?:o(?:ver|ut)|down|move|up)|ve)| ..." at REQUEST_FILENAME. [file "/usr/local/apache/conf/modsec2.user.conf"] [line "121"] [id "950004"] [msg "Cross-site Scripting (XSS) Attack"] [data ".cookie"] [severity "CRITICAL"] [tag "WEB_ATTACK/XSS"] [hostname ""] [uri "/journals/lib/pkp/js/jquery.cookie.js"] [unique_id "UHwGaq3NfJcAAFfkr74AAAIL"]

I've gone ahead and disabled the rule [950004] that this was triggering so now it should be pulling up for you without a 406 error.

However taking a look at you Rewrite rules I don't think it's going to do what you seem to be explaining it to do.

You currently have it setup so that if someone types in:

The actual request is written to:

Is this the end goal you were trying to accomplish? Or were you attempting to get rid of [/journals] when it is typed in? Because currently you don't have a (index.php) script in just your main [/public_html] directory, so if you're trying to rewrite requests there from the [/journals] directory you're going to run into problems.

Please let us know exactly what you're trying to accomplish as (.htaccess) rewrites might not be the best option to use.

- Jacob

You must login before you can post a comment about this answer.

Like this Question?

Support Center Login

Social Media Login

Social Login Joomla

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Need more Help?


Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!