6

I am using OJS and I have installed it inside a folder called "journals". I have created some journals there (for example "journal1", "journal2", etc).

Now I am getting paths like this: www.example.com/journals/index.php/journal1, www.example.com/journals/index.php/journal2, etc.

What I want is to map www.example.com/journals/index.php/journal1 to looks like www.example.com/index.php/journal1 (removing the journal part from URL).

I can't move OJS to root because I have some other files there.

Here is the .htaccess file which I am using currently (it's in "journals" folder and giving me a 500)

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond $1 !^journals
RewriteRule ^(.*) /journals/$1 [L]
</IfModule>

Also Here is the error.log

[Fri Oct 12 22:16:45 2012] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. 
MBanerjee
  • 207
  • 1
  • 4
  • 10

1 Answers1

3

When you put those rules inside the htaccess file in your /journals directory, it's causing a rewrite loop. $1 never starts with journals because you're inside the journals directory, thus the rule keeps getting applied.

You'll need to put something like this in your htaccess file in your site-root, the / directory:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/journals
RewriteRule ^index\.php(.*)$ /journals/index.php$1 [L]
Jon Lin
  • 142,182
  • 29
  • 220
  • 220
  • Hi Jon-Its working fine.but now both site/journals/index.php/journal1 and site/index.php/journal1 are accessible.How Can I disable site/journals/index.php/journal1 part and only site/index.php/journal1 – MBanerjee Oct 13 '12 at 21:38