Questions tagged [htaccess]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
9
votes
5answers
7k views

How do I force SSL on Craft?

I've installed a ssl cert on a site and it's working. Now I want to redirect visitors coming in on http over to https I've put this code and only this code in the htaccess file, but it's causing a ...
5
votes
1answer
1k 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 ...
5
votes
1answer
464 views

What's the most efficient way to handle a redirect of the home page?

I dont't currently need a home page on the personal site I'm working on but I want to be able to keep the option open in the future. I currently have {% redirect 'portfolio' %} as the only code on ...
4
votes
2answers
1k 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'...
4
votes
1answer
699 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 ...
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 ...
3
votes
2answers
2k views

How do I install Craft in shared hosting that doesn't allow index.php in a sub-folder

I’ve got a small, low traffic site that I’ve rewritten with Craft and a Bootstrap responsive grid, mainly as a learning exercise. The original site has just a dozen static pages, and is hosted with ...
3
votes
1answer
4k 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....
3
votes
2answers
326 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 ...
3
votes
2answers
1k views

Multi locale, multi-domain Live Preview failing

I have a multi-locale site set up with the different locales in different domains phoseon.craft.dev - English site phoseon.it.craft.dev - Italian site etc. I am having problems getting Live Preview ...
3
votes
1answer
3k views

htaccess www to non-www redirect (and config.php)

I need to set up a redirect from the www version of my site to the non-www version for SEO. I found a solution that would work here if it weren't for the fact that it breaks the index.php redirect ...
3
votes
1answer
609 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 ...
3
votes
1answer
689 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 ...
2
votes
2answers
1k 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 ...
2
votes
1answer
2k 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=...
2
votes
2answers
3k views

How can I redirect HTTP to HTTPS with a local self assigned SSL certificate in my .htaccess?

I'm having trouble redirecting HTTP to HTTPS with a self assigned SSL certificate generated by MAMP PRO using the following code in my .htaccess: RewriteEngine On RewriteCond %{HTTPS} !on RewriteRule ...
2
votes
1answer
1k 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 ...
2
votes
2answers
3k 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 ...
2
votes
1answer
708 views

Restrict control panel by ip address?

Has anyone ever limited access to Craft's back-end via ip address? What paths should I limit if I'm wanting to ensure only certain ip addresses can post updates? Thanks!
2
votes
1answer
2k views

URL rewrites not working return Apache 404's

Content is accessible via example.com/index.php?p=page-name but not via example.com/index.php/page-name or example.com/page-name. The .htaccess and 'omitScriptNameInUrls' => true are both in place ...
2
votes
1answer
407 views

Using Routes to load Controller

I love routes, but they appear limited to loading a specific template. What about loading a plugin/controller based on the route instead? Anyway to do this in craft or am I limited to .htaccess?
2
votes
2answers
1k 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/...
2
votes
2answers
594 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 ...
2
votes
1answer
107 views

Have Craft deliver single page despite having a directory of the same name in the public folder?

I just switched my company's website to Craft, and I have a lot of already existing static webpages that I would rather not remake as templates and define routes for. I have a single page made in ...
2
votes
0answers
339 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
2answers
428 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 ...
1
vote
3answers
540 views

redirect on a Structure

Client has created /exhibitors but wishes it to point to /exhibitors/partners Can that be done using routes or should we be looking at htaccess rules?
1
vote
2answers
3k 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 ...
1
vote
2answers
3k 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
138 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
2answers
351 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 ...
1
vote
2answers
936 views

403 when editing the Homepage

When I edit the homepage in the cp I get a error 403. But only on the homepage. Very weird. The Error is: You don't have permission to access /public/admin/entries/homepage/2-homepage on this ...
1
vote
1answer
678 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
1answer
921 views

Return to specific locale based on cookie?

If we are storing a cookie of a locale the user choose, is there a way to detect that cookie in htaccess so the next time they visit the base url of the site it will take them to the same locale?
1
vote
2answers
27 views

Duplicate content from www and non-www

I am getting duplicate content issues because both www and non-www are being loaded. My htaccess has the standard force https as all my other sites but it isn't working. # START Force https ...
1
vote
1answer
444 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
2k 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
1answer
319 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. ...
1
vote
1answer
130 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
2answers
407 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 ...
1
vote
1answer
4k 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 ...
1
vote
1answer
32 views

Incorrect canonical URLs and redirect chains

I have installed SEOMatic. However, I am getting incorrect canonical URLs. Here is an example: https://jenoffvanhulle.com/en/ The URL has a trailing slash, the canonical URL not A second problem is ...
1
vote
1answer
70 views

500 Internal Server Error when accessing admin

I just get a server error when trying to access /admin, or any other URL. This is a completely new installation on a staging server. The 'Welcome' page shows OK. I'm guessing this is a .htaccess ...
1
vote
1answer
112 views

.htaccess file not rewriting url

Hi I'm having major problems trying to get my .htaccess file to rewriteRule or redirect one url to another. I've used .htaccess before on other cms installs and always work but for the life of me I ...
1
vote
1answer
581 views

Refused to display/connect when previewing entry on multi-site setup

I run a multi-site setup with four sites; one on unicorn.com and one on all-your-base.com. The way Craft CMS licensing works, you can run multiple sites on different domains on the same license/...
1
vote
1answer
381 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
135 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
vote
1answer
105 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
472 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 ...
1
vote
1answer
459 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 ...