I had developed a website using Codeigniter. It was working good in localhost. When i hosted it and clicked on links i get "Internal Server Error".
Also i'm not able to see .htaccess files. Please tell me what i'm missing.
Works perfectly
Localhost:
$config['base_url'] = 'http://localhost/site/';
Welcome
When clicked above link, it goes to below url and works perfectly
http://localhost/site/welcome/page
Hosted
Public Web Server (Error):
$config['base_url'] = 'http://www.mysite.com/';
Welcome
When clicked above link, it goes to below url and gives an error
http://mysite.com/welcome/page
If you have access to the Apache error logs check those for why you are getting the 'Internal Server Error.'
On a Linux server those are usually found in '/var/log/apache2/error.log.'
On a Windows server they can by default be found in something like 'C:\Program Files\Apache\logs.' Or you can find out the location by looking in the conf file or virtual hosts conf file if you use that.
try
Welcome
see docs http://ellislab.com/codeigniter/user-guide/helpers/url_helper.html
OR to hide index.php
add .htaccess file
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond $1 !^(index\.php)
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
Related
I have a URL that looks like:
DomainName/admin_panel/messages.php?order_id=7&to_id=7
I want to convert this URL to:
DomainName/admin_panel/messages
I have create a .htaccess file like below but it's not working on live server as well as on localhost. URL remains the same.. Check the .htaccess file below..
RewriteEngine On
RewriteBase /
RewriteRule ^messages/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$ messages.php?order_id=$1&to_id=$2 [NC,L]
Kindly help me. The website is hosted on Dreamhost. Thanks in advance..
I have a very simple rewrite rule. My entire .htaccess file is as follows:
RewriteEngine On
RewriteRule ^login/([a-zA-Z0-9-/]+)$ company-page.php?company_url=$1
RewriteRule ^login/([a-zA-Z0-9-/]+)/$ company-page.php?company_url=$1
This is perfectly run on locally Wamp server but not working on online server. It display following error.!
The requested URL /EZsample/login/mereco-technologies/ was not found on this server.
Can anyone help me!
if you are using a VPS please use this article,
1.Make sure u have enabled Mod_Rewrite ?
2.Made the changes in the virtual host configurations
https://www.digitalocean.com/community/tutorials/how-to-set-up-mod_rewrite
This line of code helped me solve a very similar issue:
Options -MultiViews
I tried .htaccess on my local server (localhost) and it's working well.
But when upload this code to life server not working ... i don't know why ?!!
This is the content of .htaccess file
RewriteEngine On # Turn on the rewriting engine
RewriteRule ^home/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([0-9]+)/?$ home.php?country=$1&name=$2&listingId=$3 [NC,L]
the expected that url work ... it's work on localhost only ... but on live server it's give me 404 notFound
MY-DOMAIN.COM/home/USA/David/1234
My live server is www.000webhost.com
have you tried to follow the advice given by your hoster and put RewriteBase / at the top of the .htaccess file?
see http://www.000webhost.com/faq.php?ID=16
I've created a web service using php, slim and mysql but when I try to access the urls it gives me "The server encountered an internal error or misconfiguration and was unable to complete your request."
When I check the log it gives me :
C:/wamp/www/task_manager/.htaccess: Invalid command '.htaccess', perhaps misspelled or defined by a module not included in the server configuration
I checked few things online and I can ensure you that rewrite_module is installed and activated (not commented in the http.config
does anyone know how to fix that?
I ll attach the content of my .htaccess
.htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ %{ENV:BASE}index.php [QSA,L]
Remove the line .htaccess from your .htaccess file.
if you install new wamp on your system,
and you are using htaccess in your project to rewrite some urls first you need:
Click on wamp icon and Go to "Apache" Then Click on "Apache Modules"
and make sure your RE WRITE extension should be checked.
I am trying to access localhost on my xampp via the Chrome browser but I get this error message:
Object not found!
The requested URL was not found on this server. If you entered the
URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404
Apache and MySQL are turned on so I don't understand.
You can access "localhost" just fine.
The "404: file not found" error indicates the server can't find the requested file once you've connected to localhost.
ADDENDUM:
Maybe try to create a regular html file called test.html in one of
your vhosts that is not working. Then try to visit that url. That
should give you some clue as to what may be the problem. – Gohn67
This is good advice. Try it. Specifically:
1) Create the following five files:
C:/xampp/htdocs/dummy-host.localhost/test.html
C:/xampp/htdocs/my/test.html
C:/xampp/htdocs/launcher/public_html/test.html
C:/xampp/htdocs/website/httpdocs/test.html
C:/xampp/htdocs/my/test.html
2) Make sure each of these directories exist, and each has a "test.html" with the words "TESTING 1...2...3" in it
3) Try each of these five URLs in your browser:
http://localhost/test.html
http://itutormaths.web/test.html
http://itutormaths.mod/test.html
http://itutormaths.hub/test.html
http://my.itm/test.html
4) Report back the exact error you get from each browser URL
Navigate here:
http://localhost/
If that works, everything is okay.
Paste wordpress to xampp/htdocs, and you should not get any error.
I had a similar issue and this is how I resolved it:
Open the httpd:conf file on the Apache module in XAMPP (click the Congif button)
Scroll through the file - after the first set of comments (#) there is a line of code which says 'Listen 80'. Change this to 81 (or whatever other port you want to use).
Open web browser and explicitly define the port in the web address:
127.0.0.1:81
The may or may work for you; I initially had the issue that Apache wouldn't start at all, which is why I changed the port number (couldn't be bothered to figure out which service was using port 80 - if you want to you can use the command netstats -a or netstats -b in command prompt to figure it out)
Hope this helps
I just encountered this and solve this by creating .htaccess file.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /yourfoldername/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>