apache - Rewriting URLs in htaccess -


i trying rewrite url's. urls this

www.domain.com/index/c/index/ www.domain.com/index/c/about/ www.domain.com/index/c/store/

i these urls following:

www.domain.com www.domain.com/about www.domain.com/store

i have tried several different things in htaccess file haven't had luck.

rewriterule ^([^/.]+)/?$ /index/c/$1 [l]

okay, admittedly not awesome @ either htaccess or regex, i'm trying learn more helps:

it looks you're trying match follows first slash after url.

this slash should included in rewrite base, you'd want htaccess be:

rewriteengine on rewritebase /  rewriterule ^(.*)$ index/c/$1 [l] 

if you'd rather not match everything, try using ranges such as

rewriterule ^([a-za-z])$ index/c/$1 [l] think should match letters.

also, please note rewriteengine on , rewritebase / key lines! need them htaccess work. (although / part of rewritebase can modified, in case want use '/')


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -