Forums | Mahara Community

Support /
Clean Urls


29 October 2014, 2:14

Hello,

I try to have Clean Urls in my Mahara but it does not match and I don't undestand why...

I use : Centos, Apache2, Mahara 1.8.1

Reading the wiki guide for Clean URL : 

1/ I added this lines in my VirtualHost :

>>  [config.php] :  $cfg->wwwroot = 'https_:_//_eportfolio_._ensta-bretagne_._fr/ ';

(I use somme "_" caracter because I am not allowed to post links)

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^https_:_//_eportfolio_._ensta-bretagne_._fr/user/([a-z0-9-]+)/?$ https_:_//_eportfolio_._ensta-bretagne_._fr/user/view.php?profile=$1&%{QUERY_STRING}
RewriteRule ^https_:_//_eportfolio_._ensta-bretagne_._fr/user/([a-z0-9-]+)/([a-z0-9-]+)/?$ https_:_//_eportfolio_._ensta-bretagne_._fr/view/view.php?profile=$1&page=$2&%{QUERY_STRING}
RewriteRule ^https_:_//_eportfolio_._ensta-bretagne_._fr/group/([a-z0-9-]+)/?$ https_:_//_eportfolio_._ensta-bretagne_._fr/group/view.php?homepage=$1&%{QUERY_STRING}
RewriteRule ^https_:_//_eportfolio_._ensta-bretagne_._fr/group/([a-z0-9-]+)/([a-z0-9-]+)/?$ https_:_//_eportfolio_._ensta-bretagne_._fr/view/view.php?homepage=$1&page=$2&%{QUERY_STRING}
</IfModule>

 

>> In httpd.conf, I can read : LoadModule rewrite_module modules/mod_rewrite.so and this file is present in the modules folder.

2/ [config.php]

$cfg->cleanurls = true;

 

3/ under site Administration > Extensions > Clean Urls : I regenerated all clean URLs.

=> All genarated profile, groupe homepage and portfolio page URLs were OK (green).

 

>> But it does not seem to work.

For exemple :

https_:_//_eportfolio_._ensta-bretagne_._fr/user/kirkbrje   :  NOK

https_:_//_eportfolio_._ensta-bretagne_._fr/user/view.php?id=8  :  OK

 

Please, what's the problem with my configuration ?

Jean-Paul

 

 

Kristina Hoeppner's profile picture
Posts: 4863

02 November 2014, 16:19

Hello Jean-Paul,

Did you only check the clean URL for the admin or also for other users? The admin URL is not always directly generated as you are logged in as admin. Let us know if other URLs appear clean to rule out a general issue.

Usually, the admin account is properly generated when I run the site admin option a second time and then log out and log back in as admin.

Cheers

Kristina

 

03 November 2014, 21:15

Hello Kristina,

thank you for your help, unfortunately it does not work.

With my admin account I generated those urls : 

Generated 704 profile URLs

Generated 208 group homepage URLs

Generated 634 portfolio page URLs

 

Then I log out / log in .... same problem...

 

Aaron Wells's profile picture
Posts: 896

07 November 2014, 15:01

Hi Jean-Paul,

What those redirects are supposed to do, is rewrite certain URLs on the backend. So for instance if everything's working correctly, these two URLs should give you exactly the same page:

1. https://eportfolio.ensta-bretagne.fr/user/view.php?profile=kirkbrje

2. https://eportfolio.ensta-bretagne.fr/user/kirkbrje

URL #1 works correctly for me, but URL #2 gives me a 404 "Page not found" error. So this tells me that the problem must be with your Apache configuration.

I'm not sure exactly what's wrong, but that's a starting point at least. What point release of Apache are you using? (i.e. 2.1; or 2.3; etc). There are some pretty big differences between some of the Apache 2 versions.

Basically, you need the rewrites to rewrite the URLs like this (I'm shortening them to just the path part in order to save space):

1. /user/USERNAME -> /user/view.php?profile=USERNAME

2. /user/USERNAME/PAGENAME -> /view/view.php?profile=USERNAME&page=PAGENAME

3. /group/GROUPNAME -> /group/view.php?homepage=GROUPNAME

4. /group/GROUPNAME/PAGENAME -> /view/view.php?homepage=GROUPNAME&page=PAGENAME

Cheers,

Aaron

4 results