Scalalang2
Scalalang2

Reputation: 546

I wonder about .htaccess rule

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 

RewriteRule ^([a-zA-Z0-9_-]+)$ index.php/$1 [L]
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ index.php/$1/$2 [L]
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ index.php/$1/$2/$3 [L]
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ index.php/$1/$2/$3/$4 [L]

you can see my code..

$1/$2/$3/$4 .. (now)

$1/$2/$3/$4/$5 ~ $unlimited (I wanted)

sorry my bad english..

do you understand?

Upvotes: 0

Views: 149

Answers (1)

Jon Lin
Jon Lin

Reputation: 143846

If you want unlimited ([a-zA-Z0-9_-]+)/'s, you could just match for [a-zA-Z0-9_-/]+ and call it a day:

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 

RewriteRule ^([/a-zA-Z0-9_-]+)$ index.php/$1 [L]

Upvotes: 1

Related Questions