How to test rewrite
Pinguin
Joined: 2005-09-27
Posts: 210 |
![]() |
It is a long time ago, that I installed a gallery. Where can I test with 3.04 that rewrite works? |
|
tempg
Joined: 2005-12-17
Posts: 1857 |
![]() |
No idea what you're asking. |
|
Pinguin
Joined: 2005-09-27
Posts: 210 |
![]() |
In Gallery 2 there was an option, if the Apache rewrite module works. Can this be testet with G3 too? |
|
tempg
Joined: 2005-12-17
Posts: 1857 |
![]() |
I don't know that there's a module to test it, but you can easily see if you have rewrite on the server. Back up everything. <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^(.*) http://galleryproject.org/node/110922 [NC,L] </IfModule> Visit your website and see what happens. If you get redirected here, it works. (Be sure to put everything back afterwards, or your site will be down.) EDIT: I think the php info page also lists all install modules: http://codex.galleryproject.org/Gallery3:FAQ#How_do_I_create_a_phpinfo_page.3F |
|
Pinguin
Joined: 2005-09-27
Posts: 210 |
![]() |
Thanks, now I know it works, but before I did forget to enable it for apache and I searched at other places. So I asked if there is a tool to check it. |
|
tempg
Joined: 2005-12-17
Posts: 1857 |
![]() |
I used (and still use) Gallery2 some, but I've never used the tool to check rewrite. Thanks for asking; the answer may help others. |
|
Pinguin
Joined: 2005-09-27
Posts: 210 |
![]() |
Setting up a server needs a lot of configuration, but with Ubuntu most things are activated automatically, so I forgot it. You need to execute "a2enmod rewrite". That*s all. Compare eg http://www.dscripts.net/2009/01/19/how-to-enable-mod-rewrite-in-apache-server/ I didn't notice it, because at first sight, the gallery seemed to work. |
|
bhonhoff
![]()
Joined: 2008-04-05
Posts: 11 |
![]() |
I've moved my server to a new version of Ubuntu LTS and on the new installation I am facing the same 'rewrite' problem as described above. I've tried the .htaccess test above, but it doesn't seem to redirect. So apparently it is active, but somewhere disabled. I've added "RewriteEngine On" in the httpd.conf in /etc/apache2/ the phpinfo() doesn't provide much more information as in the php.ini from apache2. Any idea's? |
|
Pinguin
Joined: 2005-09-27
Posts: 210 |
![]() |
Did you restart apache? Try to shut down the server completely and start it again or reboot it, but sometimes shutdown is better. |
|
bhonhoff
![]()
Joined: 2008-04-05
Posts: 11 |
![]() |
Yes, I've restarted Apache. And rebooted the server as well. (Although it should not be necessary on an Ubuntu machine) |
|
tempg
Joined: 2005-12-17
Posts: 1857 |
![]() |
bhonhoff wrote:
I am facing the same 'rewrite' problem as described above Maybe I'm reading too quickly, but I don't know what the problem is. The OP was looking for a way to see if rewrites were active, but not really facing a "problem," as I understood it. Reading your post, I'm assuming your issue is that your rewrites aren't working and, therefore, your G3 install doesn't work. Correct? I'd need more info to assist any further--especially if you have server access and have made changes to config/Apache files. Try removing any and all htaccess files that you've added. Then test a single basic rewrite (redirecting your entire site somewhere else). |
|
bhonhoff
![]()
Joined: 2008-04-05
Posts: 11 |
![]() |
Thanks for the suggestion. I will do that this evening, after taking it of the world wide web. Keep you informed. |
|
bhonhoff
![]()
Joined: 2008-04-05
Posts: 11 |
![]() |
Hi, Solved! It turned out that the culprit was /etc/apache2/sites-available/default. <Directory /var/www/> After changing a $sudo service apache2 reload did it for me. |
|