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 » Wed Jan 14, 2015 11:57 pm

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

Re: mod_rewrite issue

Post by Thorsten » Thu Jan 15, 2015 10:52 am

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 » Thu Jan 15, 2015 5:39 pm

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

Re: mod_rewrite issue

Post by Thorsten » Thu Jan 15, 2015 5:40 pm

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 » Thu Jan 15, 2015 7:15 pm

Yes, everything works except content and category..

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

Re: mod_rewrite issue

Post by Thorsten » Thu Jan 15, 2015 8:05 pm

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 » Thu Jan 15, 2015 8:09 pm

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

Thx,

Giorgio

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

Re: mod_rewrite issue

Post by Thorsten » Sat Jan 17, 2015 12:43 pm

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 » Sat Jan 17, 2015 10:11 pm

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

Re: mod_rewrite issue

Post by Thorsten » Sun Jan 18, 2015 10:56 am

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 » Mon Jan 19, 2015 11:04 am

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

Re: mod_rewrite issue

Post by Thorsten » Sat Jan 24, 2015 7:47 am

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 » Sat Jan 24, 2015 3:09 pm

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

Re: mod_rewrite issue

Post by Thorsten » Sat Jan 24, 2015 3:55 pm

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 » Sat Jan 24, 2015 3:58 pm

yes, many times..

Thx,

Giorgio

Post Reply