php - .htaccess file not able to rename subfolder instead getting page not found -


i have search alot on google , on stackoverflow.com too. have found questions , answer unfortunately no answer working me. have written cms kind web application in public access files on root control panel files resides on admin folder. want control panel files should run using http://www.example.com/administrator url, have written .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, when tried www.example.com/administrator. getting page not found error. please me. have mistaken in .htaccess file.

i have been refer rename folder using rewrite folder name using .htaccess

i have tried 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 getting page not found error. knowledge using godaddy hosting. above example working fine localhost. not working on godaddy hosting.

try these rules in root .htaccess:

rewriteengine on rewritecond %{http_host} ^example\.com$ [nc] rewriterule (.*) http://www.example.com/$1 [r=301,l]  rewriterule ^administrator(.*)$ /admin$1 [nc,l] rewriterule ^authenticate _checkaccess.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]  rewritecond %{request_filename}.php -f rewriterule ^([^.]+)/?$ $1.php [l] 

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -