Does anybody know how to fix this?!
I create new account on my server, upload files but htaccess file keep deleting all its contents, i make changes and save but again i get empty htaccess. These same files are already on sites that work, on same server, and there is no problems with htaccess
Related
I'm creating a website, and I wanted to upload a new version to the server. The problem is the .htaccess file.
I changed the file structure. Previously, I had an app folder with index.php in it, and .htaccess automatically removed the ending to make the url look like www.sitename.com/app.
Now app is app.php file, and same .htaccess removes .php to make the url look the same as before.
For users who have visited the site before, the redirection will not work, because it seems that the browser's cache is blocking them (after deleting everything works as it should). I'm still fairly new to web development, so is there any option to prevent this?
I had a wordpress installation on my website : www.kud-ivancice.hr, I deleted the files, and droped the tables, and then copied my new website on the server. I edited my .htaccess, deleted the wordpress code and now it states : DirectoryIndex index.html, but when i try to open the page, it doesn't work. This is the first time I'm doing this, and am feeling quite lost. Any tips?
I have a file hosted at http://example.com/old-directory/document.pdf.
I'm not able to change the link, but I need to change the directory the file is downloaded from.
Current dir
/my/web/server/current/files/document.pdf
New dir
/my/web/server/new/files/document.pdf
What's the best method of changing the directory without changing the URL with PHP/Apache?
You can use a .htaccess to remap that location to a different directory (or just that file).
Create a .htaccess file and use this syntax to "redirect" the file:
Redirect /olddirectory/oldfile.html /newdirectory/newfile.html
This will send the new file instead of the old one when accessed.
If you need to do something more specific, this generator will work fine.
I installed Drupal on my website. It works perfectly but to reach the front page I'm systematically redirected to a page called "Index of" and I have to click on the subfolder drupal-7.12/ to reach the front page. So, the real url for my website i guess is
http://www.mysite.com/drupal-7.12
On my ftp server is organized like this:
Folder public_html
-> Folder drupal-7.12 + a file .htaccess
There is another .htaccess file inside the folder drupal-7.12
I know that I have to modify one of them but i don't know which one and what i have to modify ?
I hope that someone will understand my problem and could help me
Thanks
ML
I would suggest that you remove the folder in drupa.7.12 and move everything up one directory. Basically you are set up as:
Mysite/drupal7.12
move all the contents of drupal 7.12 up one directory to your public_html folder
Or you need to edit the htaccess in the public_html folder to redirect you to that folder. But that is going to cause some issues in the long run.
I don`t know anything about .htaccess files except how to secure a folder or deny access.
I want to deny direct access to .js files (by typing the file name in url) on my server, say the files are stored in a folder named /js/ how can I use the .htaccess to do that?
You cannot do that.
Actually there is no 'direct access' or 'indirect access'. The browser accesses the JS file the same way when you load it from a SCRIPT tag and when you try to load it separately (typing the file name in browser).