
0
Respuestas
How to configure Ajenti V hosted website with extension less URL
I am trying ways to configure my website to be extension less. That is when .php or .html files are visited, it'll be redirected to an URL without the extension.
Anyone has successfully configured their Ajenti V with this?
Anyone has successfully configured their Ajenti V with this?
Respuesta

0
Respuesta
Respuestas
Eugene Pankov (Project coordinator) hace 9 años
It's possible by adding a Custom Configuration code to your content entries. Example: http://stackoverflow.com/questions/19975218/remove-php-from-url-with-rewrite-rule

Respuesta
Respuestas
It's possible by adding a Custom Configuration code to your content entries. Example: http://stackoverflow.com/questions/19975218/remove-php-from-url-with-rewrite-rule

Hey, thanks!
So I did tried this on my Ajenti V > Websites > my website > Manage > Advanced and pasted:
What could I be doing wrong?
So I did tried this on my Ajenti V > Websites > my website > Manage > Advanced and pasted:
location / {However when I try to visit: www.mywebsite.com/dir/page.php, browser prompts to download "page.php" and it's not showing as a page.
try_files $uri $uri.php $uri/;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
What could I be doing wrong?

Ooops, so I awfully did it wrong. My bad. :)
I was able to get it working now. For the benefit of everyone, who may be also a beginner like me, here's what I did:
I gone through Ajenti V > Websites > my website > Manage > Content and created two (2) PHP Fast CGI entries:
Entry #1
URL pattern:
Entry #2
URL pattern:
Restart web services and try now. Hope this helps!
I was able to get it working now. For the benefit of everyone, who may be also a beginner like me, here's what I did:
I gone through Ajenti V > Websites > my website > Manage > Content and created two (2) PHP Fast CGI entries:
Entry #1
URL pattern:
/Advanced:
try_files $uri $uri.php $uri/;
Entry #2
URL pattern:
\.php$Advanced:
include fcgi.conf;
Restart web services and try now. Hope this helps!

The include directive is probably isn't needed here because Ajenti V adds it automatically for all PHP entries. I've posted your config as a KB article here: http://support.ajenti.org/topic/476525-/
Servicio de atención al cliente por UserEcho