I have the following setup:
Wamp server with Apache 2.4.27, PHP 7.1.8
Then I am using our own CMS to develop a website.
It is installed in the www folder under PeerCMS$/test/ ($ to hide it in wamp overview)
Now I am browsing to http://localhost/PeerCMS$/test/structure
This is working fine. It displays our CMS stucture page to generate a database. When we save this, it will be saved to stucture.json in the same test folder.
After this, http://localhost/PeerCMS$/test/structure isn't reachable anymore. 404 Not Found.
If we remove the .json file, it is reachable again.
This is our .htaccess:
RewriteEngine On
RewriteBase /PeerCMS$/test/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]
I think that one is ok.
Does anyone know where to look for this?
Related
I am on a Apache server and have created a site with php using a MySQL database on IONOS.
I want to redirect the URLs from /page.php?id=xxx to /page/xxx
I have written a .htaccess file and uploaded it into the root folder. It worked fine until yesterday. I have looked all IONOS support pages and different websites, but I can't find what's the issue.
My htaccess file looks like this:
RewriteEngine On
RewriteBase /
RewriteRule ^page/(.*)$ page.php?id=$1 [QSA,L]
When I try to access the page with /page/xxx, it can't get the xxx id variable.
RewriteBase / is not required in DocumentRoot. Also, your RewriteRule appears to be reversed:
RewriteRule ^page\.php?id=(.*)$ /page/$1 [QSA,L]
I developed a website using CodeIgniter on a server, and I'm trying to migrate it to the production server but I'm getting a 404 error. Again, the website is working perfectly on the development server so all I did was copy the files and the database from one server to the other.
Here is the .htaccess file of the website folder (copied from the original installation):
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
</IfModule>
On the original server, the main URL was http://myowndomain.com/websitename/preview
Now it should be like http://www.websitename.com/preview
So yes, the website is in a subfolder in both cases, and the fies are exactly the same. I also checked the Apache configuration using "phpinfo()", and I can see that the "mod_rewrite" module is loaded.
The home page is working though ( http://www.websitename.com/preview ), it's able to run the index.php file, but all the links on the page don't work.
What am I missing?
Thanks
So I have attempted to install Drupal 8.2.4 onto a dedicated server that I own.
I am running WampServer 3.0.4 64-bit with PHP 5.6.19 and MySQL 5.7.11.
I successfully get through the installation wizard and to the main page of the website however when I try to go to various pages, none of them work.
This appears to be an issue with Clean URLs. During the installation I get a warning message that Clean URLs is not enabled.
However, I have checked my apache config and rewrite_mod is enabled.
I tried to manually access the admin page # ?q=admin/config/search/clean-urls however it just returns me to the index page.
I've taken a look over the guide here: https://www.drupal.org/node/15365
I tred modifying my httpd.conf by adding the following to the bottom:
RewriteEngine on
RewriteBase /mms-beta
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]
However, then the server won't start.
I've also ensured that for /www/ the AllowOverride is set to All for the purposes of htaccess.
Can someone give me an idea as to what I need to do to get this to work?
UPDATE: So I tried adding garbage to my .htaccess file and it doesn't break, so its clear my htaccess file is not even being read.
Ok, solved.
You need to add an alias under Apache through the wamp tray icon and then modify the conf file.
In the conf file specify as follows:
AllowOverride All
Then delete:
require local
Now htaccess will work correctly.
Completely new to Wordpress and I am working on a collaborative project however I am having trouble getting up and running.
This is what I have done so far...
Installed MAMP.
Went to PHPmyadmin and created a database (e.g. myblog).
Downloaded Wordpress.
Copied and pasted existing wp-content into my downloaded Wordpress folder in htdocs and also renamed that folder from 'wordpress' to '/myblog'.
Went to localhost selected /myblog.
Installed Wordpress
Went to dashboard click visit site.
Now getting Not Found
The requested URL /myblog/lessons/orientation/ was not found on this server.
Would anyone know what I am doing wrong here?
You need to add the htaccess rewrite rules for WordPress to your MAMP server. Without these rewrite rules, the browser request doesn't actually get routed to be handled by WordPress.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
In MAMP, you have to add these rules in the MAMP app itself and not in an .htaccess file (unless you specifically configure MAMP to allow that).
Here is a screenshot of where to do that in MAMP 2, the field is called "Customized Virtual Host Directory Settings"
Dashboard>Settings>Permalinks try changing your permalink setting.
I have recently completed my first laravel site, but now I am stuck with deployment. This is an entirely new concept for me. My webspace is supplied by 1&1.
I have attempted several tutorials, but none seem to work.
Based on the tutorial here at:
Uploading Laravel Project onto Web Server
I structured my server folders like so:
(note when first FTPing my server, there was no www or html_docs, only a logs folder).
In the www, my index.php was altered to:
require __DIR__.'/../laravel/bootstrap/autoload.php';
$app = require_once __DIR__.'/../laravel/bootstrap/start.php';
In the laravel/bootstrap/paths.php file I altered:
'public' => __DIR__.'/../../www',
When visiting my domain in a browser, for example: myDomain.co.uk - the site is redirected to a "placeholder" (named /defaultsite) page for 1&1 domains and states "This domain name has just been registered."
If I append /www/index.php for example, I get file does not exist, even though the file is residing in my structure above.
As you probably noticed I am very new to server side aspects such as FTPing ect. I have read a few tuts, and all seem to take a different approach, leaving me confused to the best method.
I am not sure where to go from here, so any advice is appreciated. Thank you.
Edit:
I think I actually got it working, but now when I go to domain.com/public I get what I think is a DB error:
SQLSTATE[HY000] [2002] No such file or directory.
Any Advice please?
The reason you are seeing /public/index.php is because you are pointing to the top level directory and not the /public directory. To fix this go to:
Manage domains
Expand your domain and click "Edit Destination"
Change the destination directory to /public/.
This should remove public from the URL.
This is the .htaccess file I use for 1and1 and laravel 4.2 and it removes .index.php and also uses an updated version of PHP:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
AddHandler x-mapp-php6 .php
AddType x-mapp-php6 .php
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ /index.php [L]
</IfModule>
All fixed :) turns out 1&1 do not host their db name as local host, or 121.0.0.1. I simply changed the details and works a dream. next step is to get rid of the terrible /public/index url.