Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

534
Vistas
Url rewrite rules error: The requested URL was not found on this server

I am create the rules in the .htaccess file in my domain folder.

My url on server is :

https://www.everyoneknows.com.my/customer/?loc=dashboard

And I want change url to:

https://www.everyoneknows.com.my/customer/dashboard/

In the .htaccess file, I write the rules are:

RewriteEngine On

RewriteCond %{HTTP_HOST} ^everyoneknows\.com\.my [OR,NC] 
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.everyoneknows.com.my/$1 [R,L]

##External redirect to /customer/dashboard url rules here.
RewriteCond %{QUERY_STRING} ^loc\=dashboard$
RewriteRule ^customer/$ https://www.everyoneknows.com.my/customer/dashboard/? [R=301,L]

And the error message is shown:

Not Found
The requested URL was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

picture

Hope someone can guide me on how to correct in my rewrite url rules. Thanks.

Original result:

enter image description here

Updated 1

enter image description here

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You need a redirect rule for old URL to new and an internal rewrite rule to handle pretty URL:

RewriteEngine On

RewriteCond %{HTTP_HOST} ^everyoneknows\.com\.my [OR,NC] 
RewriteCond %{SERVER_PORT} 80
RewriteRule ^ https://www.everyoneknows.com.my%{REQUEST_URI} [R=301,NE,L]

# external redirect from actual URL to pretty one
RewriteCond %{THE_REQUEST} \s/+(customer)/\?loc=([^\s&]+) [NC]
RewriteRule ^ /%1/%2/? [R=301,L,NE]

# internal forward from pretty URL to actual one
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(customer)/([\w-]+)/?$ $1/?loc=$2 [L,QSA,NC]

This assumes there is no .htaccess in customer/ subdirectory. Make sure to clear your browser cache before testing this change.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda