mod_rewrite issue

All about webserver configurations, PHP and databases.

Moderator: Thorsten

gap
Posts: 8
Joined: Wed Jan 14, 2015 11:49 pm

mod_rewrite issue

Post 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
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: mod_rewrite issue

Post by Thorsten »

Hi,

what errors do you get exactly?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
gap
Posts: 8
Joined: Wed Jan 14, 2015 11:49 pm

Re: mod_rewrite issue

Post 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
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: mod_rewrite issue

Post by Thorsten »

Hi,

is the RewriteBase in .htaccess correct?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
gap
Posts: 8
Joined: Wed Jan 14, 2015 11:49 pm

Re: mod_rewrite issue

Post by gap »

Yes, everything works except content and category..
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: mod_rewrite issue

Post by Thorsten »

Hi,

can I check your FAQ somewhere?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
gap
Posts: 8
Joined: Wed Jan 14, 2015 11:49 pm

Re: mod_rewrite issue

Post by gap »

It's in the intranet, I can only share some of the config files.
Let me know what you need.

Thx,

Giorgio
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: mod_rewrite issue

Post by Thorsten »

Hi,

I need as much info as possible.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
gap
Posts: 8
Joined: Wed Jan 14, 2015 11:49 pm

Re: mod_rewrite issue

Post 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
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: mod_rewrite issue

Post by Thorsten »

Hi,

the RewriteBase is wrong, it should be

Code: Select all

RewriteBase /
instead of

Code: Select all

RewriteBase /kb/
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
gap
Posts: 8
Joined: Wed Jan 14, 2015 11:49 pm

Re: mod_rewrite issue

Post 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
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: mod_rewrite issue

Post 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
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
gap
Posts: 8
Joined: Wed Jan 14, 2015 11:49 pm

Re: mod_rewrite issue

Post 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...
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: mod_rewrite issue

Post by Thorsten »

Hi,

did you restart Apache?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
gap
Posts: 8
Joined: Wed Jan 14, 2015 11:49 pm

Re: mod_rewrite issue

Post by gap »

yes, many times..

Thx,

Giorgio
Post Reply