You are here:  » MultiViews and mod_rewrite


MultiViews and mod_rewrite

Submitted by ser_seven on Sun, 2006-08-20 07:01 in

I have some problems with the htaccess, the web server returns me the error 500 internal server error, but I am sure that the mod_rewrite works on my web server. I have already installed other script with htaccess.

I'm post the code source of another htaccess that works with another script.

# enable mod_rewrite
RewriteEngine on
# mod_rewrite rules for categories pages
RewriteRule ^(.*)/$ index.php?category=$1 [QSA,L]
RewriteRule ^(.*)/index([0-9]+).html$ index.php?category=$1&page=$2 [QSA,L]
# mod_rewrite rule for suggest link page
RewriteRule ^suggest-link([0-9]+).html$ suggest-link.php?id=$1 [QSA,L]
# mod_rewrite rules for new links page
RewriteRule ^new-links.html$ new-links.php [QSA,L]
RewriteRule ^new-links([0-9]+).html$ new-links.php?page=$1 [QSA,L]
# mod_rewrite rules for top links page
RewriteRule ^top-links.html$ top-links.php [QSA,L]
RewriteRule ^top-links([0-9]+).html$ top-links.php?page=$1 [QSA,L]
# mod_rewrite rules for popular links page
RewriteRule ^popular-links.html$ popular-links.php [QSA,L]
RewriteRule ^popular-links([0-9]+).html$ popular-links.php?page=$1 [QSA,L]
# mod_rewrite rules for editors links page
RewriteRule ^editor-links/index.html$ editor-links.php [QSA,L]
RewriteRule ^editor-links/index([0-9]+).html$ editor-links.php?page=$1 [QSA,L]
# mod_rewrite rules for view link page
RewriteRule ^(.*)/(.*)-l([0-9]+).html$ view-link.php?cat=$1&title=$2&id=$3 [QSA,L]
# mod_rewrite rules for news page
RewriteRule ^news.html$ news.php [QSA,L]
RewriteRule ^(.*)-n([0-9]+).html$ news.php?title=$1&id=$2 [QSA,L]
# mod_rewrite rules for additional pages
RewriteRule ^p(.*).html$ page.php?name=$1 [QSA,L]
# mod_rewrite rules for error pages
RewriteRule ^([0-9]+).htm$ error.php?error=$1 [QSA,L]
ErrorDocument 500 /dir/500.htm
ErrorDocument 404 /dir/404.htm
ErrorDocument 403 /dir/403.htm
ErrorDocument 401
 /dir/401.htm

Where can the problem be?

tnks

Submitted by support on Sun, 2006-08-20 07:24

Hello Ser,

At what point do you get the "500 Internal Server Error"?

When you view the home page?

When you view the merchant index?

Also, where is Price Tapestry installed in your site - is it in the root directory, example:

http://www.example.com/

~or~ a subdirectory, example:

http://www.example.com/prices/

If the latter, have you modified .htaccess with RewriteBase:

RewriteBase /prices/

Submitted by ser_seven on Sun, 2006-08-20 07:30

Hello,
PT is installed in root directory.
this error is in all page
index page, merchant pages, categories pages ecc ecc

tnk you

Submitted by support on Sun, 2006-08-20 07:30

Do you have access to your web server's error log?

That should give the reason for the 500 code...

Submitted by ser_seven on Sun, 2006-08-20 07:35

Sorry i dont have access in this service :(

Submitted by support on Sun, 2006-08-20 07:42

Ok,

First thing, be very carefull that there are no characters in your .htaccess file that shouldn't be there.

Can you describe the process you went through to go from htaccess.txt in the distribution to .htaccess on your server?

It might also be a permissions problem, if Apache cannot open .htaccess?

Can you email me the URL to your site; it is easier if I can take a look sometimes....

Cheers,
David.

Submitted by ser_seven on Sun, 2006-08-20 07:46

I rename htaccess.txt in .htaccess I should have does correct.
I send her a mail with the data of my domain.

Sorry your mail ?

Submitted by support on Sun, 2006-08-20 07:48

You can reply to your email you got when you joined this forum - I will get that...!

Submitted by ser_seven on Sun, 2006-08-20 07:52

ok you have mail

Submitted by support on Sun, 2006-08-20 08:09

For the record; this turned out to be the first line of .htaccess causing the internal server error:

Options -MultiViews

This presumably means that MultiViews is not installed, and so it is not a valid option to disable. Therefore, this line can be safely removed.

Submitted by ser_seven on Sun, 2006-08-20 08:16

Thanks it now works
To thing it serves the MultiViews?

Submitted by support on Sun, 2006-08-20 08:19

MultiViews is an Apache module that tries to work out what page was meant to be viewed when an incomplete URL was entered; and it can cause problems with some types of ReWrite rules beacause it overrides them!

Therefore, whenever I work on mod_rewrite I always disable MultiViews - but as the module is not installed on your server it doesn't matter!

Cheers,
David.

Submitted by ser_seven on Sun, 2006-08-20 08:20

ok
thanks still for you support
talk to you soon