0

I am using apache2 in ubuntu m/c. I have enabled mod_rewrite and changed Allowoveride All in apache2.conf

Now I am trying to install Bug-Genie application in my server But following .htaccess rules are not work as excepted.

I can access :

http://localhost/roxsoft/thebuggenie-3.2.6/thebuggenie/**index.php**/wiki

But I can't access : --404 error

http://localhost/roxsoft/thebuggenie-3.2.6/thebuggenie/wiki

Here is my .htaccess file:

# .htaccess file for The Bug Genie

# make sure that magic_quotes and register_globals is always off
<IfModule mod_php5.c>
    php_flag magic_quotes_gpc   off
    php_flag register_globals   off
</IfModule>

# rewrite rules
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
# Example:
# RewriteBase /
# or
# RewriteBase /dev/thebuggenie

  # skip all hidden files (starting with a .)
  RewriteCond %{REQUEST_URI} \..+$
  RewriteCond %{REQUEST_URI} !\.(html|wsdl|json|xml)$
  RewriteRule .* - [L]

  # redirect to front controller
  RewriteRule ^(.*)$ index.php?url=$1 [NC,QSA,L]

</IfModule>
# Stop people accessing directories they shouldn't have access to
RedirectMatch 403 ^/\.svn(/|$)

2 Answers 2

3

Try this:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|assets|images|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

Add the folder which contains the JavaScript and CSS to the rewrite condition

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for quick reply.. your code works fine but I need to filter assert files like css, js, images etc... With your code every URL gets rewritten with index.php/****
0

Here is the solution I just managed it with. This may help if anyone had a same problem...

I just removed

and added additional conditions in htaccess here is it:

  RewriteCond %{REQUEST_URI} \..+$
  RewriteCond %{REQUEST_URI} !\.(html|wsdl|json|xml)$
  RewriteCond %{REQUEST_URI} !\.(jpg|png|css|js|php|gif|ttf|woff)$   ---- ADD FILTER CONDITION.
  #RewriteRule .* - [L]                                              ---- COMMENT THIS LINE************

  # redirect to front controller
  RewriteRule ^(.*)$ index.php?url=$1 [NC,QSA,L]

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.