Questions tagged [.htaccess]

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

Filter by
Sorted by
Tagged with
3
votes
1answer
45 views

.htaccess not working (apache2 | ubuntu 18.04)

guys the website is working fine, just the file .htaccess that doesn't work, i googled a lot, already enabled a2enmod rewrite and tried a lot of stuff but it didn't work. obs: i'm using the website ...
1
vote
1answer
33 views

How to add .htaccess code to apache2.conf?

I want to add my .htaccess code into /etc/apache2/apache2.conf. I want to combine these: .htaccess file. <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f ...
1
vote
1answer
33 views

How should a rewrite rule look like in htaccess

I want the visitors to sub.example.com to be redirected to https://sub.example.com:9545 Is this possible with .htaccess? If so how should it look?
0
votes
1answer
95 views

Laravel .htaccess problem

Trying to configure my website on the hosting according to SEO requirements (www exclusion and https) getting cycling redirect as a result. Can't figure out what's wrong. Hosting has Ubuntu 16.04.5 ...
0
votes
0answers
53 views

CORS error with XMLHttpRequest

We are trying to add AddThis to our web app and getting the CORS error. The apache .conf file has-- <VirtualHost *:443> DocumentRoot /var/www/html/stg/sites/default/sandboxJDunn/public ...
0
votes
2answers
115 views

htaccess redirect problem

So, Say I have my shopping cart at foo.com/a I want to redirect shoppers to foo.com/b At foo.com my .htaccess contains RedirectMatch 302 ^/(index\.html)?$ foo.com/b But people still land on foo....
0
votes
0answers
230 views

Apache/htaccess: How to allow read/download file

I'm searching how to allow read/download file to from my website for any file with any permission in my web directory. It should be an good thing if I could allow it also for the sub-directories. ...
2
votes
1answer
239 views

How do I write an Apache .htaccess file to force a 'friendly' URL?

I have a small PHP MVC framework which runs on a droplet that uses Ubuntu and I'm trying to make all the URLs 'friendly'. From: index.php?u=controller/method/param To: controller/method/param For ...
2
votes
1answer
92 views

Apache web server - how to strip language extentions

This question pertains to publishing the Ubuntu Serverguide on help.ubuntu.com. For the 20.04 LTS cycle, there will (O.K. might) be significant changes to the source code workflow for the Ubuntu ...
0
votes
1answer
122 views

How to make .htaccess to unhide the directory [closed]

I'm creating a VM for my students to hack into, however the directory containing .htaccess is hiding the directory they need to access to CTF. The only way you can find this directory is if you ...
0
votes
2answers
448 views

multiple redirects in .htaccess file - execute first one

I am attempting to use .htaccess to redirect a single page in expression engine to another site's page. Our .htaccess file has a ton of other rewrite rules and rewrite conditions to ensure the ...
1
vote
1answer
530 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
2answers
1k 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
245 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 ...
1
vote
1answer
72 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
154 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
165 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
640 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
907 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
804 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
829 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
93 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
2answers
7k 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
3answers
12k 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
497 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
37k 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
2k 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
348 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
1k 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
69 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
270 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
111 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
813 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
27 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
306 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
62 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
214 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
65 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
308 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
56 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 ...
3
votes
1answer
5k 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
137 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
6k 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
267 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
174 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
4k 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
189 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 ...