Page 1 of 2

mod_rewrite issue

Posted: Wed Jan 14, 2015 11:57 pm
by gap
Hi,
I am having some trouble configuring the mod_rewrite. I have setup a webserver with a single ip that hosts different platforms (phpmyfaq, drupal and phpipam to be precise). My phpmyfaq is reacheble thru a dns entry. When I configure apache's mod_rewrite everything work correctly when is use the ip/phpmyfaq url. When I use the dns entry instead it exhibits some unexpected behaviour, mod_rewrite works correcdtly for the menu entry but it doesn't for the category and content.

What should I do?

Thanks,

Giorgio Apuzzo

Re: mod_rewrite issue

Posted: Thu Jan 15, 2015 10:52 am
by Thorsten
Hi,

what errors do you get exactly?

bye
Thorsten

Re: mod_rewrite issue

Posted: Thu Jan 15, 2015 5:39 pm
by gap
Hi,

I get a not found page.

E.g.:
"
Not Found

The requested URL /content/7/9/it/rimuovere-ctrlaltcanc-windows-7.html was not found on this server.

"

Giorgio

Re: mod_rewrite issue

Posted: Thu Jan 15, 2015 5:40 pm
by Thorsten
Hi,

is the RewriteBase in .htaccess correct?

bye
Thorsten

Re: mod_rewrite issue

Posted: Thu Jan 15, 2015 7:15 pm
by gap
Yes, everything works except content and category..

Re: mod_rewrite issue

Posted: Thu Jan 15, 2015 8:05 pm
by Thorsten
Hi,

can I check your FAQ somewhere?

bye
Thorsten

Re: mod_rewrite issue

Posted: Thu Jan 15, 2015 8:09 pm
by gap
It's in the intranet, I can only share some of the config files.
Let me know what you need.

Thx,

Giorgio

Re: mod_rewrite issue

Posted: Sat Jan 17, 2015 12:43 pm
by Thorsten
Hi,

I need as much info as possible.

bye
Thorsten

Re: mod_rewrite issue

Posted: Sat Jan 17, 2015 10:11 pm
by gap
This are the configuration I made:

.htaccess
=========

Options +FollowSymlinks -MultiViews -Indexes

# if you want to use mod_rewrite, set this 'On'
RewriteEngine On

# the path to your phpMyFAQ installation
RewriteBase /kb/

Apache Virtual Host
=================

<VirtualHost *:80>
ServerName kb.be-trentino.it
DocumentRoot "/var/www/kb"

<Directory "/var/www/kb">
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Do you need more?

Thx,

Giorgio

Re: mod_rewrite issue

Posted: Sun Jan 18, 2015 10:56 am
by Thorsten
Hi,

the RewriteBase is wrong, it should be

Code: Select all

RewriteBase /
instead of

Code: Select all

RewriteBase /kb/
bye
Thorsten

Re: mod_rewrite issue

Posted: Mon Jan 19, 2015 11:04 am
by gap
Hi,

now I get that when I go to the kb thru the dns name I get the default apache page instead of the phpmyfaq.

Thx,

Giorgio

Re: mod_rewrite issue

Posted: Sat Jan 24, 2015 7:47 am
by Thorsten
Hi,

after reading your configuration I assume the FAQ should be available under http://kb.be-trentino.it/, right? So the RewriteBase should be / as there's no other directory from this URL...

bye
Thorsten

Re: mod_rewrite issue

Posted: Sat Jan 24, 2015 3:09 pm
by gap
Hi,

Actually that rewrite rule is correct as it is.
It's the apache virtual host configuration that doesn't work because when I visit the kb.be-trentino.it the browser displays the standard apache "it works" page that is located in the /var/www folder instead of redirecting to the /var/www/kb folder but I cannot understand why...

Re: mod_rewrite issue

Posted: Sat Jan 24, 2015 3:55 pm
by Thorsten
Hi,

did you restart Apache?

bye
Thorsten

Re: mod_rewrite issue

Posted: Sat Jan 24, 2015 3:58 pm
by gap
yes, many times..

Thx,

Giorgio