# [solved] Getting mod_rewrite to work with b2evolution?

## StifflerStealth

Hi,

I wanted to make my URLs nice with the feature built into b2evolution in the settings area. It turns index.php?id=2... stuff into the name of the blog. I found the info on the b2evo homepage that states that you need to place: 

```
<IfModule mod_rewrite.c>

   RewriteEngine on

   RewriteBase /

   RewriteCond %{REQUEST_FILENAME} !-f

   RewriteCond %{REQUEST_FILENAME} !-d

   RewriteRule . /index.php [L]

 </IfModule>
```

 inside a .htaccess file in the directory the main index.php file is in. I do this and it did not work. pages with the blog name, e.g.: b2evolution/ewt would return a page not found, but when I turn the feature off in the blog, I can access b2evolution/index.php?blog=1 just fine.

I did a search on these forums and on Google, but nothing other people have tried for this app or something else works. I even tried to put this: 

```
<Directory "/var/www/localhost/htdocs/b2evolution">

   RewriteEngine on

   RewriteBase /

   RewriteCond %{REQUEST_FILENAME} !-f

   RewriteCond %{REQUEST_FILENAME} !-d

   RewriteRule . /index.php [L]

</Directory>
```

 in my default_vhost.include file and restart apache, but that didn't work either.

I am exhausted of ideas. Can anyone help me?Last edited by StifflerStealth on Fri Aug 31, 2007 2:51 am; edited 1 time in total

----------

## StifflerStealth

No one knows the answer to this?  :Sad: 

----------

## elgato319

hmm..

i'm not sure if this code will do what you wanted to do.

http://manual.b2evolution.net/MultipleDomains

 *Quote:*   

> 
> 
> You have to create a .htaccess file (or append it to an existing one) in your blog root directory (e.g. blogs/.htaccess) with the following content:
> 
> # BEGIN b2evolution
> ...

 

----------

## StifflerStealth

Thanks for your reply, but if you read the first post, you will see that I tried that.

I have tried it several ways:

I put the .htaccess file in /var/www/localhost/htdocs/ (doc root) and I get an error 500: Internal Sever Error.

Then I try it in /var/www/localhost/htdocs/ b2evolution/ But I just get a page not found error. I do change the file accordingly. When it's in Doc Root, I have /b2evolution for the base line, then when it's in the b2evolution dir, I just have / in the line.

I look in the log for the info on the internal error, and I see:

RewriteBase: argument is not a valid URL

----------

## StifflerStealth

I played around with the .htaccess file for a long time. I had to do two things to solve this:

1) I searched online for info on why mod_rewrite was exceeding the redirect limit and I solved that by adding:

RewriteCond $1 !\.php$

2) The last line had to be changed from RewriteRule . /index.php [L] to RewriteRule . /b2evolution/index.php [L]

so my final .htaccess file looks like: 

```
<IfModule mod_rewrite.c>

   RewriteEngine on

   RewriteBase /b2evolution

   RewriteCond %{REQUEST_FILENAME} !-d

   RewriteCond %{REQUEST_FILENAME} !-f

   RewriteCond $1 !\.php$

   RewriteRule . /b2evolution/index.php [L]

 </IfModule>
```

Hope this helps anyone trying to install this.

----------

