Hi every one... i wrote a htaccess script as follows RewriteRule (.*) index.php [L] Code (markup): but it redirect all the requests including css and images.so the css files are not loaded.how to handle the htaccess to allow request to css and image files... thanks in advance
Add the below line into your .htaccess file. This line is used to tell the apache that don't redirect for the following extensions RewriteCond %{REQUEST_URI} !\.php$ RewriteCond %{REQUEST_URI} !\.gif$ RewriteCond %{REQUEST_URI} !\.jpg$ RewriteCond %{REQUEST_URI} !\.png$ RewriteRule (.*) index.php [L] Code (markup):
Options +FollowSymLinks RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule administrator$ adminlogin.php RewriteRule (.*).html index.php RewriteRule (.*) index.php?action=profile&name=$1 RewriteRule !\.(js|ico|gif|jp?g|png|css)$ index.php Code (markup): this is my htaccess file.. my need is when click on the http://localhost/mysite/signin.html it goes to signin page http://localhost/mysite/username will goes to the users profiel page. if i use the replied script http://localhost/mysite.signin.html and http://localhost/mysite/username are redirect to the index.php page only.. help me...thanks..
Thankyou Friends... finally requirement was solved by this code..... Options +FollowSymLinks RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule administrator$ adminlogin.php [L] RewriteRule (.*).html index.php [L] RewriteCond %{REQUEST_URI} !\.php$ RewriteCond %{REQUEST_URI} !\.gif$ RewriteCond %{REQUEST_URI} !\.jp?g$ RewriteCond %{REQUEST_URI} !\.png$ RewriteCond %{REQUEST_URI} !\.css$ RewriteCond %{REQUEST_URI} !\.js$ RewriteRule ^(.*) index.php?action=profile&name=$1 [L] Code (markup): Thnks to all