简体   繁体   中英

Using HTACCESS rewrite rule I can't modify my URL Structure of my website

My Host Name -> ps129202.dreamhostps.com domain -> http://www.uastudents.com/

My Url structure : one is /innerpage.php?lang=3&pageid=6&name=SELECT%20PROGRAM AND other one /index.php?lang=3

Here is my .htaccess code :

RewriteEngine On     
RewriteBase / 
RewriteRule ^(.*)/images/(.*)$ images/$2
RewriteRule ^(.*)/css/(.*)$ css/$2
RewriteRule ^([0-9]+)$ index.php?lang=$1
RewriteRule ^([0-9]+)/([0-9]+)/([a-zA-Z]+).php$ innerpage.php?lang=$1&pageid=$2&name=$3

My url Structure is domain/innerpage.php?lang=3&pageid=6&name=SELECT%20PROGRAM and domain/index.php?lang=3 Desired url is : domain/3/6/SELECT%20PROGRAM and domain/3 I really puzzled can't run it anyway.. how Can I solve ??? Any other process there ??

Try this:

RewriteRule ^([0-9]+)$ index.php?lang=$1 [L]
RewriteRule ^([0-9]+)/([0-9]+)/(.+)$ innerpage.php?lang=$1&pageid=$2&name=$3 [L]

Also, test your regexes here , the one for innerpage.php would never work, as "SELECT%20PROGRAM" has special characters in it, not a-zA-Z.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM