Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [.htaccess]

.htaccess files (or "distributed configuration files") provide a way to make configuration changes on a per-directory basis.

1
vote
0answers
107 views

Can't access my website after server release-upgrade to 18.04 from 16.04 (droplet)

When I enter my domain i get: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator at [...
1
vote
1answer
24 views

Apache2: Exclude all the rest api Request_URIs from Basic Auth by matching with some expressions

I have setup Basic Auth for an Opencart project for browser authentication to allow access to relevant users only. Now, I need to use REST API for a mobile app. When I call an endpoint from the API to ...
1
vote
1answer
69 views

.htaccess Redirect results in a redirect loop

So on my site, my shopping cart is located at example.com/zc2. I use this .htaccess file: RewriteEngine On Redirect /index.html https://example.com/zc2/ So that anyone that lands on example.com ...
0
votes
1answer
23 views

Restricting Apache VirtualHosts to their own directory

I'm running Apache on Ubuntu 16.04 and 18.04, and I have configured it to accept connections from several domains. The sites are all stored in /var/www/html like so: example.com sub.example.com ...
1
vote
0answers
33 views

Apache Rewrite sends to previous directory, local index.php not read

I can't solve a problem I have with (seemingly) Rewrites in Apache2. It's a migration from server P3 (where everything works) to server P10. The config files are the same, as well as the directory ...
0
votes
0answers
47 views

htaccess bad bot in access.log

I added this in my htaccess: RewriteEngine On RewriteBase / RewriteCond %{HTTP_USER_AGENT} ^SemrushBot [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^Yandex [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^rogerbot ...
0
votes
0answers
54 views

<htaccess file permission error

I am trying to access and edit my cloud front address on my .htacess file i tried several times with my mac terminal it was not working now i am trying on my Ubuntu OS thinking that it was a MAC book ...
0
votes
0answers
359 views

^$ Home page rewrite in htaccess not working, ubuntu 14.04

I am running ubuntu 14.04 with apache 2.4.x. I created virtual host mydomain.local. All my website works perfectly on local machine except home page i.e. http://mydomain.local/ I can run anything ...
0
votes
1answer
563 views

rest api ubuntu 17.10 apache mod_rewrite .htaccess

I just try and try and try ... I can't get a redirect to my index.php (restful api). .htaccess: Options -MultiViews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [QSA,...
0
votes
1answer
299 views

How to redirect all subpage to its main page?

I have migrated a static site to WordPress, now I need to redirect its pages, I have many URLs those will go one page, I can redirect one by one but those are many so I need a redirect rule that works ...
1
vote
1answer
398 views

My wordpress site shows the .htaccess content instead of output

I would like to migrate another wordpress site to Linode servers. I had no errors before and is doing great except now. Here's what I did. Back up my website’s Files Exported the WordPress Ddtabase ...
0
votes
1answer
41 views

Apache rewrite rules error

Some rules are working properly, and everything is properly set up in the conf files to allow rewrites to work correctly But some rules are failing or may be the url string doesnot reach that rule and ...
1
vote
1answer
3k views

How to Edit Apache2.conf | Permission Denied - Amazon AWS (EC2)

I'm trying upload the edited apache2.conf but getting File Permission Denied Error. Status: Starting upload of O:\Users\Circle Radius\SRPL\apache2.conf Command: cd "/etc/apache2" Response: New ...
1
vote
0answers
1k views

Lamp in Ubuntu 16.04 and .htaccess file - not work

I installed on Ubuntu 16.04 LAMP from this tutorial: enter link description here. When I installed only Wordpress on this LAMP everything works correctly. but when I copied my page on Wordpress, ...
2
votes
2answers
7k views

.htaccess is not working on Ubuntu 16.04.2 LTS

I want to use .htaccess for rewriting of php web pages. Or in a simple way "I don't want to use .php extension" to access any web page. .htaccess file (Ubuntu 14) which was working perfectly: ...
0
votes
1answer
309 views

Custom url in my local site (problem with .htaccess file)

I have a Wordpress site and I want my url as: localhost/site/contact, for example. But, the system is displaying the follow: You should update your .htaccess now. If your .htaccess file were ...
1
vote
1answer
24k views

The requested URL was not found on this server

A question asked many times and yet I didn't find an answer that helped me. I have an Apache Server running under Ubuntu 12.04.5 LTS (yes I need to update). I have a webpage in /var/www/website/...
0
votes
2answers
774 views

.htaccess is not visible in /opt/lampp/htdocs

I have an .htaccess file saved in /opt/lampp/htdocs, the problem is, the file exists in the folder but I can't find it nor view it. Anyone knows how I can view it?
0
votes
1answer
257 views

Can I add my .htaccess config to my sites-enabled virtual host .conf file?

I understand that httpd.conf is no longer available in Apache at /etc/apache2. A fix is that I could create a httpd.conf file as detailed here and point my apache2.conf to it. But browsing through ...
0
votes
1answer
678 views

htaccess - how to remove 'index' from url [closed]

RewriteEngine on RewriteBase / AddDefaultCharset utf-8 RewriteCond %{HTTP_HOST} ^(?!www\.)(.+) [NC] RewriteRule ^(.*) http://www.%1/$1 [R=301,NE,L] ErrorDocument 404 https://%{HTTP_HOST} Options ...
0
votes
1answer
61 views

problem with .htaccess

The content file .htacces: RewriteEnergie on RewriteRule ^(.*)$ index.php?p=$1 The content file 000-default.conf: the error
1
vote
2answers
3k views

Apache2 gzip not working?

I've done almost everything on the internet to gzip my content. It does not seem to work. I've done so much that I can't possibly put everything I've tried here, so here's some of the things I've ...
1
vote
2answers
229 views

Web Control Panel for Multiple Students W/Login

My teacher is trying to make a control panel for all of her students so they can use WordPress, code their website, etc. She has a server in her class so that they can use that for the web server. ...
0
votes
1answer
107 views

.htaccess is not working on ubuntu

I want to give Forbidden You don't have permission to access /draft/ on this server. so added .htaccess to folder with Options -Indexes But it's not working on ubuntu server and displaying ...
0
votes
3answers
508 views

Display Directory Listing of .htaccess password protected directory

I want to be able to password protect a specific directory but keep others free for anyone to access, but I've found out that when a directory is password protected by a .htaccess and .htpasswd file ...
0
votes
1answer
26 views

ServerName issue, either www or http, can't have both.. Why?

So everything is set up right at my dnsprovider. I have both my subdomain and my main domain directed to my ip. However I can't seem to get my subdomain to work with both with and without www. If in ...
1
vote
1answer
224 views

File .htaccess disappears

I installed ubuntu and want to put my Web script (php) what happens when I put the files via USB is the USB .htaccess disappears. Someone could help me?
0
votes
1answer
59 views

Ensuring files on the fly are not compressed to zero byte

Gzip is enabled, i requested for site whose size is 2.7kb. Unfortunately the site was compressed to zero byte. How do you state code in htaccess to ensure files should not be compressed to zero byte ...
0
votes
1answer
168 views

RewriteCond is not working

In my .htaccess file RewriteRule .* /test/index.php [L] This code working fine on apache2 on ubuntu server. But when I add this line RewriteCond %{QUERY_STRING} foo It's not working. It working ...
2
votes
1answer
62 views

accessing htaccess protected pages from ubuntu touch browser

I tried to access a webpage, which is password protected by htaccess (apache server ...) from my bq aquaris running Ubuntu touch 5.0. The browser gave me no options to enter the username/password and ...
1
vote
1answer
301 views

Setting up apache2 on ubuntu to avoid index.php in joomla

I have an ubuntu 14.04 azure virtual machine serving a couple of different sites. www.example.com is set up to ip 1.2.3.4 (my server) and is redirected to 1.2.3.4/example. This works fine. <...
0
votes
1answer
1k views

Ubuntu/14.04 / Apache2 configuration issues? Not sure what I am doing wrong Laravel: default route will render but others will not.

Laravel will render the default / root page normally. but will not render default routes or error pages. My web browser will return with Apache (NOT Laravel) error pages with I try and access /test ...
0
votes
1answer
55 views

.htaccess not routing as designed when rewriting dates

I have an .htaccess which is not performing as I think it should. I have a WP site which the owners decided to move the base path for the blog entries as /blog/, so all posts are 404ing now from ...
2
votes
1answer
4k views

.htaccess file not running and internal server error

I am using ubuntu 14.04 and have LAMP environment. I have one of the project in dir /var/www/html/project1 . It can't access the .htaccess file for rewriting url rules. For that i have to change in /...
0
votes
1answer
133 views

htaccess redirection from one page to subdomain [closed]

Mys site has some subdomains (sub1,sub2...etc) I want to redirect any of my subdomains from one page to another: from: http://sub1.example.com/dir/page1 to https://sub1.example.com/ is the below ...
0
votes
3answers
4k views

Remove '.php' from url - Nothing works

Ubuntu 14.04LTS 32bit LAMP I know it's an old question but.. I need it to remove .php anywhere it finds it from the visible url. It needs to work with /showthread.php?id=XX ---> /showthread?id=XX ...
0
votes
1answer
226 views

Apache 2.4: pcfg_openfile unable to check htaccess / php warning include() failed opening for inclusion

Situation I've installed Ubuntu 14.04 on my desktop, and now need to get Apache 2.4 working with my local websites. With 12.04 this all worked. Now I get two errors, and googling for these errors I ...
0
votes
1answer
126 views

Apache custom errors

I'm having trouble with doing custom error messages in Apache. I've read Apache documentation and basic syntax is quite clear and simple. Only problem I'm having is I don't know in what config file I ...
5
votes
2answers
3k views

Why do I get 404 on LAMP Permalinks (Using wordpress)

I have been working on a website on an ubuntu server (amazone) and I get 404s entering pages. I'll give all the information I can regarding the problem. On WordPress Refresh page: I followed ...
0
votes
1answer
163 views

Trying to enable .htacccess in apache2 but my default.conf is relatively empty

I've been trying to enable .htaccess for all of my domains in apache2 which is running on ubuntu 14.04, but my default configuration file in /etc/apache2/sites-available appears rather barren in ...
1
vote
0answers
761 views

.htaccess and VirtualHost not working

I'm having trouble getting my .htaccess to work with the Laravel PHP framework on Rackspace Cloud Server/Ubuntu 14/Apache 2. Mod_rewrite is enabled using sudo a2enmod rewrite. I've reset and ...
1
vote
1answer
4k views

FIXED] Apache2 URL Rewrite using Joomla - Permission issue? (500 internal error)

FIXED I am using LAMP with Joomla 3.3.4 on ubuntu desktop I am currently using the local ip (192.168.x.x) to access the site as I don't have a domain name yet while I am still developing the web ...
4
votes
5answers
23k views

how to config htaccess file after enabling mod_rewrite module?

I already install apache2 then i enable the mod_rewrite module like this: sudo a2enmod rewrite after enabling i am confused about these lines, i can't understand what to do with them, as far as i ...
8
votes
2answers
19k views

.htaccess Error : Invalid command 'AuthGroupFile'

before this i was working on windows and my project was working proper. recently i moved to ubuntu and i am trying setup project on LAMP. i have created host for this (windows i was running directly ...
1
vote
1answer
1k views

How To Create A Custom ErrorDocument Page In Ubuntu 14.04?

I am new to Ubuntu and I am using Ubuntu Server 14.04. Now I want to use my own design HTML web pages as my server status errors like on 404 etc. I tried my own way but not getting my designed page ...
0
votes
3answers
2k views

SuPHP: PHP 403 ErrorDocument in Apache won't work

I am trying to set up an 403 error document in Apache, using a PHP file, like this (via .htaccess): order deny,allow deny from all allow from [MY_IP] ErrorDocument 403 /err403.php but it doesn't ...
0
votes
2answers
7k views

Where should I place the .htpasswd file (phpMyAdmin)?

I am following this tutorial setting up phpMyAdmin: https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-on-ubuntu-12-04 I edit the .htaccess file at /usr/share/...
2
votes
1answer
374 views

DocumentRoot is password protected but no htaccess file?

At some point I pw protected /var/www/ for security purposes (my actual hosted websites are located in a different path), now I would like to host something publicly in /var/www/ but do not know how ...
1
vote
2answers
2k views

Enable use of .htaccess in apache2

This might not be directly related to Ubuntu itself, but the directory tree is different here and I'm kind of confused. I have a website I'm trying to run and it loads fine, but it heavily relies on ...
45
votes
4answers
196k views

Is this a correct way to enable htaccess in Apache 2.4.7

In almost every solution of "How to activate htaccess", they say that the /etc/apache2/sites-available/default file needs to be edited. But there isn't such file in Apache 2.4.7 I read somewhere ...