Pergunta

I'm trying to show this url http://www.xyz.com/catnew/newcat.php as http://www.xyz.com/cat. Any help is appreciated.

Foi útil?

Solução

RewriteEngine On
RewriteRule ^cat/([^/]*)$ /catnew/newcat.php?cat=$1 [L]

The original URL:

http://www.xyz.com/catnew/newcat.php?cat=3

The rewritten URL:

http://www.xyz.com/cat/3

Outras dicas

look up tutorials on mod_rewrite, if your on Apache this may be the answer depending on how you want to do it.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top