0

Now, have the next .htaccess (in the root folder):

Options -Indexes
Options -Multiviews

RewriteEngine on

# Ocultar extension php (hidden .php)
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

# Url amigable (frienly url)
RewriteBase /
Rewriterule ^owner/servicios/(.+)/$ owner/servicios.php?servicio=$1

I expect when the user access try to "domain.com.ar/owner/index/" show the page "index.php". This not work, but, i access "domain.com.ar/owner/index" works.

On the other hand, when the user try to access "domain.com.ar/owner/servicios/servicio_uno/", $_GET value of "servicio" should be "servicio_uno", but is: "servicio_uno/.php/servicio_uno ".

And "domain.com.ar/owner/servicios/servicio_uno" shows 500 internal error.

Any ideas ?.

ramiromd
  • 2,019
  • 8
  • 33
  • 62

2 Answers2

0

depending on where is your htaccess located (root directory or /owner directory)

//if in root
RewriteBase /
Rewriterule ^owner/servicios/(.+)/$ owner/servicios.php?servicio=$1


//if in owner directory
RewriteBase owner/
Rewriterule ^servicios/(.+)/$ servicios.php?servicio=$1

Hope it helps.

Ula
  • 403
  • 3
  • 9
  • Thanks, this works !. The url is: "local.pilarme.com.ar/owner/servicios/servicio_uno", but $_GET['servicio'] have "servicio_uno/.php/servicio_uno" value (???) – ramiromd Jul 23 '13 at 05:10
  • The hidden extension are causing the error, how can solves ?. – ramiromd Jul 23 '13 at 05:12
0

Try the following

 
RewriteEngine On
RewriteBase /owner/servicios/

RewriteRule (.*) /owner/servicios.php?servicio=$1
RewriteRule ^owner/servicios/servicios.php/(.*) servicios.php?servicios=servicios=$1 [QSA,L] 

 

Hope this helps.

Kneel-Before-ZOD
  • 4,141
  • 1
  • 24
  • 26