1

I want to redirect something like:

domain/start[optional]/xxx

to

domain/something/xxx

I've tried to add to .htaccess:

# Rewrite any start* route to something route
RewriteCond %{REQUEST_URI}
RewriteRule ^start[^/]*/(.*)$ /something/$1 [R=301, L]

but I'm getting an Internal Server Error. Any idea of what I'm doing wrong?

The Apache logs says:

RewriteCond: bad argument line '%{REQUEST_URI}'

Manolo
  • 20,308
  • 18
  • 73
  • 124
  • what does the internal server error say? – TZHX Mar 13 '15 at 14:11
  • your rewriterules seems correct, you probably get the error because you have to allow overrides in htaccess. in that case, see here: http://stackoverflow.com/questions/6995545/htaccess-rewriteengine-not-allowed-here – guido Mar 13 '15 at 14:11
  • @TZHX - Question edited. – Manolo Mar 13 '15 at 14:13

1 Answers1

1

Your rule has few syntax issues. Try this rule:

# Rewrite any start* route to something route
RewriteRule ^start[^/]*/(.*)$ /something/$1 [R=301,L,NC]
anubhava
  • 713,503
  • 59
  • 514
  • 593