Hi Vincenzo!

My rewrite rule now lookes like this:

RewriteEngine on

RewriteRule ^/(css|js|fonts)(/.*)?$ /static$2 [L]
RewriteRule ^/(.*)$ /index.php/$1 [L]

and now nothing works :(


If you have any further ideas, I would thank you.


Tamer

On 07/21/13 10:46, Vincenzo D'Amore wrote:
> Hi,
> 
> IMHO the first rewrite doesn't match because regex is wrong.
> 
> The URL your rewrite should match is something like this:
> 
> /css/path/filename.css
> 
> so your regex should first match the first / character. 
> Then, don’t confuse alternation with a character class. If you want express 
> an alternation you need a group, it means rounded brackets instead of square 
> brackets.
> 
> Last but not least, the second rewrite doesn't match the first / too, I 
> suppose it worked because even if the slash is doubled the PHP code, in some 
> way, will handle it.
> 
> Honestly, after all I had no time to test my suggestion, but please try with 
> this:
> 
> RewriteRule ^/(css|js|fonts)(/.*)?$ /static$2 [L]
> RewriteRule ^/(.*)$ /index.php/$1 [L]
> 
> Best regards,
> Vincenzo
> 
> 
> On 21/lug/2013, at 07:08, Tamer Higazi <th9...@googlemail.com> wrote:
> 
>> Hi people!
>> I have problems making successfully a rewrite rule for my Webapplication
>> (CodeIgniter) with mod_rewrite.
>>
>> In my ".htaccess" file, I have the following rewrite rules:
>>
>> RewriteEngine on
>> RewriteRule ^[css|js|fonts](/.*)?$ /static$1 [L]
>> RewriteRule ^(.*)$ /index.php/$1 [L]
>>
>>
>> But the 1st rule doesn't work, neither I know if the rule was correct.
>>
>> I want first:
>>
>> /css/* -> /static/css/*
>> ,/js/* -> /static/css/*
>> /fonts/* -> /static/fonts/*
>>
>> and anything else
>>
>> /index.php/
>>
>>
>> The second rule seems to work. But the 1st rule makes me headache.
>>
>> If you have an idea, I would kindly thank you.
>>
>>
>>
>>
>> Tamer
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
>> For additional commands, e-mail: users-h...@httpd.apache.org
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
> For additional commands, e-mail: users-h...@httpd.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org

Reply via email to