I have search alot on google and even on stackoverflow.com too. I have found some good questions and their answer but unfortunately no answer working for me. I have written a cms kind web application in which public access files are on root where control panel files resides on admin folder. Now i want all control panel files should run using http://www.example.com/administrator url, for this i have written this .httacess file.
.htaccess
# BEGIN
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
RewriteRule ^single _single_Page.php [NC,L]
RewriteRule ^single/([A-Za-z0-9-]+)/?$ _single_Page.php?subid=$1 [NC,L]
RewriteRule ^findcontents$ _findContentTitle.php [L,QSA]
#RewriteRule ^findcontents/([A-Za-z0-9-]+)/?$ _findContentTitle.php?data=$1 [L,QSA]
RewriteRule ^search$ _specificPage.php [NC,L] [L,QSA]
# Admin panel redirect settings
RewriteRule ^/administrator(.*)?$ /admin$1 [NC]
RewriteRule ^authenticate _checkaccess.php [NC,L]
</IfModule>
# END
From root file working fine, but when i tried www.example.com/administrator. I am getting page not found error. Please somebody help me. what i have mistaken in the .htaccess file.
i have been refer for rename folder using rewrite a folder name using .htaccess
I have also tried this code too
RewriteCond %{REQUEST_URI} ^/administrator/(.*)$
RewriteCond %{DOCUMENT_ROOT}/admin/%1 -f [OR]
RewriteCond %{DOCUMENT_ROOT}/admin/%1 -d
RewriteRule ^ /admin/%1 [L]
but still i am getting page not found error. just for the knowledge i am using godaddy hosting. above example working fine for localhost. but not working on godaddy hosting.