0

i have a problem with .htaaccess file. I'm trying to transform url like www.example.com/news/2 to www.example.com/index.php?news=$1. So far i've tried:

RewriteRule ^news/([0-9]+)/?$ /index.php?news=$1 [NC,L]

This leads me to an error because it tries to find all sources like: www.example.com/news/styles.cssetc. What's the problem? Hta file is in the root.

U.Alex
  • 59
  • 1
  • 7

1 Answers1

0

You have three levels there when you are expecting two. Remove "/?" from the end. Also don't use /news/style.css for your css. Thats just pointless. Use /css or /css/news or /resources/news etc.

user1122069
  • 1,767
  • 1
  • 24
  • 52