I was trying to rewrite some urls witht he following rule:
it works as long as i try site.com/title-goes-hereCode:RewriteRule ^([a-z0-9-]*)$ news.php?slug=$1
but it also means that any word a-z char and 0-9 typed after site.com will be taken as slug
so when i try to use this rule (also working before apply the ^ upper one)
which would output the site.com/page-3(or 4 or whatever)Code:RewriteRule ^page$-([0-9]+)$ index.php?page=$1
i found a temporarely solution which helps the rule to "indicate" that only this type of urls should be received and "read" as slug
seems that the word test- helps to be read correctly so , when i try site.com/test-something-hereCode:RewriteRule ^test-([a-z0-9-]*)$ news.php?slug=$1
something-here is "read" as slug,which is perfectly well,but i hate to add any extra words on my urls,so i was hopeing that you can help me solve this.
The result i am looking for is this:
rewrited url --------------------------- original url
site.com/some-title-of-the-news - site.com/news.php?slug=title-of-the-news (i don't want to add any / chars e.g. sitem.com/news/tite-of-the-news if this is possible!)
site.com/page-1 - site.com/index.php?page=1
site.com/contactme - site.com/contactform.php
Thanks in advance!


Reply With Quote
Bookmarks