.htaccess - Url rewrite and trim url -
i need precious help.
i have url:
http://domain.com/v/12345
my ht access set pass 12345 php script like:
htaccess:
rewriterule ^v/([a-za-z0-9_-]+)$ /script.php?v=$1 [l]
script php:
http://domain.com/script.php?code=12345
and works perfectly but.. , there but, write url so:
http://domain.com/12345/my-dog-is-very-fat
can change htaccess works so? because if use /my-dog-is-fat or / 404 error.
i try explain better:
i share link seo keywords in url, example
mydomain.com/alphanumericcode/thi-is-my-dog-article
where alphanumericcode of myscript.php?v=
this htaccess:
rewriteengine on rewriterule ^view/([a-za-z0-9_-]+)$ /view.php?v=$1 rewriterule ^folder/([a-za-z0-9_-]+)$ /filefolderlist.php?f=$1 rewriterule ^home$ /index.php [l] rewriterule ^report$ /report.php [l] rewriterule ^play/([a-za-z0-9_-]+)$ /play.php?v=$1 [l] ###added anubhava rewriterule ^v/([\w-]+)/?$ /script.php?v=$1 [l,qsa] rewriterule ^([0-9a-z]+)/.+$ /script.php?v=$1 [l,qsa,nc] ##end rewriterule ^privacy-policy$ /privacy.php [l] errordocument 404 404.php
you can have new rule new uri scheme:
rewriteengine on rewriterule ^v/([\w-]+)/?$ /script.php?v=$1 [l,qsa] rewriterule ^([0-9a-z]+)/.+$ /script.php?v=$1 [l,qsa,nc]
Comments
Post a Comment