.htaccess - htaccess file not working in php? -


i have code , code not working

this htaccess code

rewriteengine on rewriterule ^([0-9]{1,10000})-([a-za-z0-9_]{1,10000})$ news.php?id=$2&namenews=$3   

and php code

<a href='$slidefetch->id_ar-$slidefetch->name_ar'> 

i think got few things wrong. in rewrite rule have $2/3 when should $1/2. plus have {1,10000} means min of 1 number 100000 digits long! might want have {1,6} or whatever limit is. believe there limit on length of url ~2000 characters long depending on browser/search engine, better keep them shorter!

if want 1-10000 can try:

rewriterule ^([1-9][0-9]{0,3}|10000)-([a-za-z0-9_]{1,6})$ news.php?id=$1&namenews=$2 

otherwise:

rewriterule ^([0-9]{1,6})-([a-za-z0-9_]{1,6})$ news.php?id=$1&namenews=$2              (----$1----) (-------$2--------) 

i'm not sure if have echo tag should like:

echo '<a href="', $slidefetch->id_ar, '-', $slidefetch->name_ar, '">'; 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -