Stack Exchange Network

Stack Exchange network consists of 174 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]

The tag has no usage guidance.

1
vote
1answer
29 views

Combine .htaccess. ( http to https AND www to non www AND remove trailing slash ) extending normal craftcms .htaccess

I can't manage to combine all above options. Tested with several options and examples only the most examples focusses only on on problem. The example of .htaccess below is okay but i cannot manage to ...
1
vote
1answer
12 views

Can't Get Past Control Panel Login. Keeps Redirecting Back to Login Page

I followed this guide to move my local hosting from WAMP, which has been giving me a bunch of 500 errors since switching to Craft 3, to Local By Flywheel. After getting everything configured, I can ...
-1
votes
0answers
20 views

Unable to redirect http to https in .htaccess craft

I have added a SSL certificate on my website, now I want to redirect my site from http to https. I have tried the following in my .htaccess file but it somehow doesn't work for me. RewriteCond %{...
1
vote
1answer
37 views

Multi-site Live Preview not working in Craft 3

In the multi-site Live Preview in admin panel show error in the console. Failed to load http://www.example.local/test: The value of the 'Access-Control-Allow-Origin' header in the response must not ...
1
vote
1answer
33 views

Forcing a / with .htaccess

After redirecting a website to https environment I had the difficulty that .php/ was added to the url which resulted in double content. I have been able to get past this mistake but now I need to ...
1
vote
1answer
52 views

Force redirect from HTTP to HTTPS via htaccess with multisite installation

I'm using Craft CMS 3 multisite installation with more than 20 website based on subdomains. There are websites: website.com one.website.com two.website.com with identical url paths but different ...
2
votes
1answer
363 views

No input file specified - [proxy_fcgi:error] Got error 'Unable to open primary script: [PATH]/html/index.php (No such file or directory)\n'

I have a peculiar situation that is only happening on the root domain and NOT subdomains. For example, CraftCMS (2.6.3019) running on Apache with php-fpm works fine on dev.some-domain.tld and test....
1
vote
0answers
16 views

Craft 3: Prevent craft adding script filename to URLS

I'm running Craft 3 with multi-site. Working well so far, but my hosting doesn't allow me to create traditional vhosts with their own directories and shared upper filesystem. As such I have an ...
0
votes
0answers
28 views

Rewrite rule possibly not fully working in .htaccess

Disclaimer: This is what I would call a 'cross-post' from the serverfault site and NOT a repost. My question did get answered there - at least for what I had asked in that site, though I wanted to ask ...
1
vote
1answer
234 views

How do I force www in URL along with the Patrol plugin to force https

I'm using the Patrol plugin to force https in the domain, but I also need to force www into the URL. When I do that with some htaccess rewrite rules I found online I get an error when I try to load ...
1
vote
1answer
133 views

Installing Craft in a Sub Folder

I have created a Craft CMS site on a VPS Server running CentOS 7. I have a file setup on the public_html like this: - cms craft public app (this is running a Symfony Framework Web App and runs from ...
1
vote
1answer
72 views

Simple Craft htaccess Help

I have a Craft site where I need to redirect any traffic to www (including dev.lakesideohio.com). The rule seems to be working but for some reason the url gets changed to using index.php with query ...
3
votes
1answer
353 views

Force language segment in URL on multi-lingual site

I'm setting up a multi-lingual site and want to force the language segments: domain.com/en/ domain.com/fr/ However if you go in the URL bar and remove the en/ or fr/ it loads up the English page ...
0
votes
1answer
92 views

Adding `www` causing it to have index.php

I am trying to get pretty urls In my general.php file I have 'omitScriptNameInUrls' => true, which works fine and removes the index.php BUT When I try to force a www in the htaccess the ...
0
votes
2answers
105 views

entry.url forcing https

{{ entry.url }} is generating a https:// link. I don't have SSL on this site, so the page errors out. Settings > General > Site Url is "http://..." My .htaccess is below (though I've read the ...
2
votes
2answers
476 views

Anyone with a tricked out .htaccess file

I am looking at shaving www. and enforcing https on the entire site without a plugin. All along removing the index.php. Here is my .htaccess file, it works but is it optimized. If you have any ...
1
vote
2answers
2k views

GZIP seems to compress only HTML, not CSS or JavaScript

I'm not 100% sure this is a Craft specific problem, but I'll try here, as it relates to a Craft installation. After running a number of tests, it seems that my CSS and JavaScript files are not ...
0
votes
2answers
749 views

Security Headers in htaccess Don't Work

We have an issue on our server when our Security Headers are not working. We added the following to our htaccess file after installing Craft CMS: - <IfModule mod_headers.c> Header always ...
2
votes
2answers
236 views

Printmaker fails to render images under SSL

I am using the Printmaker plugin to print a pdf. Everything seems to be working well when the site is not being forced to use SSL. I am getting the message "Failed to load PDF document." If I remove ...
1
vote
1answer
358 views

.htaccess for Craft CMS - removing segment from URL

I'm rebuilding a website which needs to run Craft CMS as the main frontend and a bespoke CRM system at the same domain. The file setup is basically public_html cms crm To make things a bit more ...
1
vote
1answer
207 views

HTTPs Site - Redirects Go to HTTP First & Then HTTPs

So I've updated the site URL in my general.php as follows: 'siteUrl' => "https://" . $_SERVER['HTTP_HOST'], I also have our web server making sure everything goes to https://www.example.com. ...
0
votes
1answer
1k views

Craft CMS login 500 (Internal Server Error)

I transferred a website using Craft CMS and now when I want login to admin the console return me jquery-2.2.1.min.js?d=1493126871:4 POST http://website.com/index.php/admin/actions/users/login 500 (...
1
vote
0answers
270 views

301 redirects are inserting “index.php” into URLs

I'm in the process of moving a site from one domain to another, so I'm setting up 301 redirects on the old domain. Everything goes well, except when the 301 redirect happens, "index.php" is inserted ...
1
vote
0answers
282 views

.htaccess trailing slashes and ajax calls

I'm building something with Craft and Vue.js and realized that I could view my page with or without a trailing slash, but when it had a trailing slash, my ajax calls to the Element API endpoint failed,...
1
vote
1answer
1k views

How to remove index.php?p= permanently?

I discovered search engines found duplicate content on my domain due to URLs being output with index.php?p= and index.php in ADDITION to the clean URLs. For example, I have: domain.com/index.php?p=...
1
vote
2answers
294 views

Why is htaccess file not named “.htaccess” on fresh install?

I run into the same error on each project setup with CraftCMS. So did I this time… again… First of all: Yes, I seem to be a slow learner. And therefore I can't memorize to rename the htaccess file ...
3
votes
2answers
672 views

htaccess non-www rewrite showing index.php in URL

I am using htaccess to rewrite any www url to a non-www version RewriteCond %{HTTPS} !=on RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L] When I type domain.com/...
1
vote
0answers
213 views

Configuring CraftCMS on Arcustech with Cloudflare flexible SSL returns 521 error

I have installed CraftCMS on an Arcustech VPS and successfully added a domain name. Using the domain without the shared SSL works without any problems (e.g. www.example.com / example.com). However ...
0
votes
1answer
176 views

Misconfiguration error when accessing URL without file name

When accessing www.myurl.com/services, I get this error below the content of my page: The server encountered an internal error or misconfiguration and was unable to complete your request. I don't ...
1
vote
1answer
223 views

Cannot omit index.php from URL

I know this question has come up many times before, although after reading and trying dozens of answers, I am none the wiser. I am currently rebuilding my website with Ubuntu 16.04, PHP7 and apache. ...
4
votes
1answer
522 views

Cannot remove index.php from URLs either

I am having the same issue as here: Another index.php?p= problem I tried to post this as a comment rather than open another post but I don't have enough reputation... I have tried all of the ...
1
vote
0answers
116 views

htpasswd issues with Craft

So I raised a previous thread here. https://craftcms.stackexchange.com/questions/16741/conflict-with-htaccess-htpswd Basically with the site behind a htpasswd (as it is a staging url) after ...
1
vote
1answer
99 views

'Unknown error' caused by redirect in htaccess

I was getting an 'unknown error' when trying to access the admin. I couldn't see anything in the Craft logs apart from 404 related errors. I replaced the app folder but still no luck, eventually I ...
1
vote
1answer
343 views

Issue with htaccess redirect adding parameters

Having an issue with htaccess redirects adding parameters to the new locations. I have done some research on this and apparently its from the default htaccess rules. I have tried a few suggestions ...
3
votes
1answer
292 views

Site will not load. Asking me to save “login” as a file

What would make a site want me to download the index.php when viewed? I downloaded the database and all files from a staging server where site was fine. When I go to any site URL on local machine it ...
1
vote
2answers
2k views

When redirecting to HTTPS from www, index.php appears in URL

I have a redirect setup for www, it successfully redirects to https:// but it includes /index.php?p= in the URL. I'm not convinced by htaccess file is configured correctly. Here's my htaccess file: ...
1
vote
2answers
108 views

Migrate WordPress Site into Craft CMS. How deal with 404's?

I migrate my WordPress site into Craft CMS. So far so good. But the URLs for most of the Blog Entries are complete new. What's the best way to handle that? My site is good linked on Google and there ...
1
vote
0answers
481 views

htaccess and favicons

I see from the Craft's default remove index.php htaccess code here that the following line takes into account favicon.ico files. RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [...
5
votes
1answer
712 views

Why am I getting ?p=oldpage in a 301 redirect?

Not sure whether this is directly related to Craft but I’ve been using this method for years and it has always worked with other sites. I’m replacing an old site and some pages have moved. I want to ...
3
votes
1answer
824 views

.htaccess max_execution_time

I want to change the max_execution_time in the .htaccess file. I tried it in this way: <IfModule mod_php5.c> php_value max_execution_time 300 </IfModule> but then I got a 500 internal ...
1
vote
1answer
372 views

Remove subdirectories from admin URL with .htaccess

I have Craft public files set up within subdirectories of a primary domain’s web root. public_html/ # default web root public_html/example.com/public_html/ # Craft public files here The following ....
1
vote
2answers
364 views

Re-using path segments for an additional domain?

I have a Craft installation with two domains pointing at it. The first domain is all working and has a number of sections including a blog located at /blog. What I want to be able to do is have a ...
0
votes
1answer
83 views

htaccess query (not Craft per se)

I'm using locales to drive several sites/domains from one build. I have set up a bunch of 301 redirects in the .htaccess to capture and redirect previous URLs. I've used RewriteCond to target the ...
2
votes
0answers
248 views

control panel login redirects back to login

First, I just took over administration of our Craft site from a previous employee, and the original site was set up by a contractor, so I'm still trying to figure things out. Yesterday it was ...
1
vote
1answer
2k views

htaccess www to non-www with subdomain

Our client has (sadly) presented a new site URL as www.foo.bar.com instead of foo.bar.com. I need to use .htaccess to remove the www. The site works correctly if www is not prepended to the URL. This ...
3
votes
3answers
1k views

redirect index.php in urls on Craft site to NEVER show index.php

We’ve recently had some issues with a staging site being down and it turned out the reason for this was: In the words of Brad at Pixel and Tonic, the redirect is "intercepting the update request for ...
1
vote
2answers
254 views

How can I use images from my live Craft Site when developing locally

I'd like to sync the database of a live site to my local site for development, but don't want to download all the images and files. Is there an .htaccess that could look for the files locally, and on ...
2
votes
2answers
1k views

Removing index.php from URL even after .htaccess updates?

I am a little afraid to post this, but I'm running into an issue and haven't found a solution yet. I've been able to successfully remove the "index.php" from all my URLs, however I'm still finding ...
0
votes
1answer
200 views

Front end profile does not save data - form action

I've been having trouble getting a front-end profile template to save any data. It was quite complex so I've gone back to a base install of Craft with no custom fields for a User. Using the example ...
3
votes
2answers
889 views

Using SSL for entire website on Arcustech server

I want to use SSL (https) for my entire website which is hosted on Arcustech. I came across two instructions, one on Craft's site which discusses forcing SSL on the CP and the other is from Arcustech'...