Take the 2-minute tour ×

How can I take all requests to www.myurl.com/{ANYTHING} and send them all to www.myurl.com/index.php

I am finding I can send everything with:

RewriteRule .* index.php [R=Permanent,L]

This works great, except I am redirected to www.myurl.com/home/username/public_html because of my cpanel/apache installation. So instead I changed my code to

RewriteBase /
RewriteRule .* index.php [R=Permanent,L]

But this causes the infinite loop again.

share|improve this question

2 Answers 2


RewriteCond %{REQUEST_URI} !^/index.php
RewriteRule .* /index.php [R=Permanent,L]
share|improve this answer

This effectively sends me to index.php without causing a loop.

RewriteCond %{REQUEST_URI} ^/index\.php$
RewriteRule ^(.*)$ - [L]

RewriteRule ^(.*)$ /index.php?url=%{REQUEST_URI} [R=302,L,QSA]
share|improve this answer

Your Answer


