mod rewrite - .htaccess working with multiple SEO friendly URL's -


i'm having problem working out how attach multiple "friendly url's" new project.

i've never had work multiple ones before don't know start. had play around couldn't come anything.

original script one:

rewriteengine on rewritecond   %{request_uri} \/([0-9a-z]{1,9})$ [nc] rewriterule   ^(.*) http://mysite.me/?%1 [l] 

i want keep exact one, need more handle other files, such couple of lines method;

view.php?p=46345 mysite.me/view/46345

hope can help, thanks!

i recommend of in code rather in apache. redirect requests 1 file (index.php, or whatever directoryindex file is) , examine url in code , transform url form want. then, return 301 transformed url. if want, can skip process files exist. avoid overhead requested assets.

here's sample .htaccess this:

options +followsymlinks +execcgi <ifmodule mod_rewrite.c> rewriteengine on  # check if file exists. if doesn't redirect main file # comment out rewritecond if don't want skip index.php existing files rewritecond %{request_filename} !-f rewriterule ^(.*)$ index.php [qsa,l] </ifmodule> 

Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -