milanello72 Posted January 27, 2014 Share Posted January 27, 2014 (edited) Hello! I have 2 problems with .htaccess . 1) I have a path http://www.myaccount.domain.com/katarina/index.php and I want to remove the folder katarina and to obtain http://www.myaccount.domain.com/index.php How could I solve this problem? 2) I have a path on localhost http://127.0.0.1:8888/katarina/index.php and I want to remove the folder katarina and to obtain http://127.0.0.1:8888/index.php (soI want to remove my folder "katarina") How could I solve this problem? Thank you! Edited January 27, 2014 by milanello72 Quote Link to comment https://forums.phpfreaks.com/topic/285704-htaccess-how-could-i-remove-a-folder-in-the-path/ Share on other sites More sharing options...
requinix Posted January 27, 2014 Share Posted January 27, 2014 What are you going to do about the file that's actually /index.php? What about all the other files in the katarina folder? Quote Link to comment https://forums.phpfreaks.com/topic/285704-htaccess-how-could-i-remove-a-folder-in-the-path/#findComment-1466695 Share on other sites More sharing options...
milanello72 Posted January 27, 2014 Author Share Posted January 27, 2014 All files from katarina forlder are staying there. (in the katarina folder) (please, excuse me beacuse I don't know to work very well with .htaccess) Quote Link to comment https://forums.phpfreaks.com/topic/285704-htaccess-how-could-i-remove-a-folder-in-the-path/#findComment-1466702 Share on other sites More sharing options...
requinix Posted January 27, 2014 Share Posted January 27, 2014 Okay, well, if you want /index.php to actually go to /katarina/index.php then RewriteRule ^/?index.php$ katarina/index.php [L] Quote Link to comment https://forums.phpfreaks.com/topic/285704-htaccess-how-could-i-remove-a-folder-in-the-path/#findComment-1466773 Share on other sites More sharing options...
milanello72 Posted February 4, 2014 Author Share Posted February 4, 2014 Hello, Requinix! I have tried, but didn't work. In this moment you could see the link here http://www.katarinabulatovic.uhostall.com/32katarina/index.php And I want to obtain http://www.katarinabulatovic.uhostall.com/index.php so without 32katarina. I have all files in the folder 32katarina and .httaccess is Options +FollowSymlinks RewriteEngine on php_flag session.auto_start 1 RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^index.html index.php [N] RewriteRule ^([a-zA-Z0-9-_]+).html$ index.php?pagina=$1 [L,QSA] RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9-.\s]+).html$ index.php?pagina=$1&poll=$2 [L,QSA] RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9-.\s]+)/([0-9-_]+)$ index.php?pagina=$1&paginaphoto=$2&id_photo=$3 [L,QSA] AddType image/x-icon .ico RewriteRule ^favicon.ico favicon.ico [NC,L] ErrorDocument 404 /errors/404 ErrorDocument 403 /errors/403 ErrorDocument 500 /errors/500 What can I add in .htaccess ? Thank you! Quote Link to comment https://forums.phpfreaks.com/topic/285704-htaccess-how-could-i-remove-a-folder-in-the-path/#findComment-1467700 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.