Laravel auth/login route not working in server but localhost - laravel-5.4

I am using laravel 5.4 default authentication system and it is working fine in localhost but when i upload my project to server, it is breaking. when i fill mail and password, it return back me 404 file not found error.
My site url is http://www.happycoder.me/imsRever2.0

You need to configure the .htaccess file as follows:
RewriteEngine On
RewriteCond %{REQUEST_URI} !^imsRever2.0
RewriteRule ^(.*)$ imsRever2.0/$1 [L]
Otherwise, the main web server will not the routing, vs laravel causing the 404 error when the file isn't found.

My htaccess file is below what things i need to change
Options -MultiViews
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

Related

How To make Custom Links Without Showing page not found error [duplicate]

I want to redirect all pages on my site (including index) to UnderWork.html
and I'm doing this using .htaccess with this code:
RewriteEngine on
RewriteRule ^(.*)$ UnderWork.html
...and its works fine.
Now I am adding some more code to my .htaccess to redirect all traffic to the non-www domain and now my code looks like this:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.domain\.in
RewriteRule ^(.*)$ http://domain.in$1 [R=permanent,L]
RewriteRule ^(.*)$ UnderWork.html
Here is where I have a problem. If I enter a URL like: domain.in/xyz then it works as before, but if I use a URL like: www.domain.in/xyz then Apache converts it to coincart.inxyz/.
What am I doing wrong here? How can I get what i want? Thanks in advance.
Below are rules that work for me:
RewriteEngine On
# Adding trailing slash for directory requests.
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{REQUEST_URI} !^/www$
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.+[^/])$ http://example.com/$1/ [R=permanent]
# External redirection from www subdomain to non-www domain.
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^/?(.*) http://example.com/$1 [L,R=permanent]
# Internal redirection to index.php for nonexistent URLs.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !\.(jpg|jpeg|png|gif)$
RewriteRule . /index.php [L,QSA]
To show a custom page when a directory root (domain root in particular) is requested, use the Apache's DirectoryIndex directive:
DirectoryIndex UnderWork.html

htaccess , can't access homepage

I'm trying to set locally a project that run on the web on a NGIX server. This is the htaccess i have downloaded:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /~sitename/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /~sitename/index.php [L]
</IfModule>
I'm trying to run it locally on an Apache server(on mamp) . It have placed the project in a folder on the server root:
http://localhost/sitename/
But i get a blank page.
I can access a specific internal page (and only that one) if i remove the tilde
~
Even without the tilde, i can't access the homepage of the project.
So what i'm doing wrong?
How the tilde works in this context ?
EDIT
my mod_rewrite is loaded/enabled

Problems in old URLs after migrating from IPB4 to XenForo 2

I have done a migration for IPB4 to Xenforo 1, and then to Xenforo 2.
There is a script to redirect the old urls to the new: https://xenforo.com/community/resources/redirection-scripts-for-invision-forums-3-x.5948/
Are two files and this htaccess... I have done a lot of changes and nothing, no redirection for the old urls.
Example of old url: http://www.foroiphone.com/foros/tema/119668-iphone-7-7-plus-movistar-post-oficial/ that goes to can't find the page
New XF2 Url: http://www.foroiphone.com/threads/iphone-7-7-plus-movistar-post-oficial.119668/
Here is:
# Mod_security can interfere with uploading of content such as attachments. If you
# cannot attach files, remove the "#" from the lines below.
#<IfModule mod_security.c>
# SecFilterEngine Off
# SecFilterScanPOST Off
#</IfModule>
ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 500 default
<IfModule mod_rewrite.c>
RewriteEngine On
# If you are having problems with the rewrite rules, remove the "#" from the
# line that begins "RewriteBase" below. You will also have to change the path
# of the rewrite to reflect the path to your XenForo installation.
#RewriteBase /ip.board
# This line may be needed to enable WebDAV editing with PHP as a CGI.
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# IPS Rewrite Rules
RewriteCond %{REQUEST_URI} /(topic|forum|user)/ [OR]
RewriteCond %{QUERY_STRING} (^|&)show(topic|forum|user)= [OR]
RewriteCond %{QUERY_STRING} ^/(topic|forum|user)/ [OR]
RewriteCond %{PATH_INFO} ^/(topic|forum|user)/
RewriteRule ^.*$ ips2xf.php [NC,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(data|js|styles|install) - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
</IfModule>

How to set-up different URLs for yii frontend and backend

For example, if I want localhost/basic.com for the front-end and localhost/basic/admin for the back-end.
I am new to the framework, however, it seems really interesting.
Please help.
I have watched tutorials and all but none seem to cover this.
You can use the following .htaccess
Options FollowSymLinks
AddDefaultCharset utf-8
<IfModule mod_rewrite.c>
RewriteEngine On
# the main rewrite rule for the frontend application
RewriteCond %{REQUEST_URI} !^/(backend/web|admin)
RewriteRule !^frontend/web /frontend/web%{REQUEST_URI} [L]
# redirect to the page without a trailing slash (uncomment if necessary)
#RewriteCond %{REQUEST_URI} ^/admin/$
#RewriteRule ^(admin)/ /$1 [L,R=301]
# the main rewrite rule for the backend application
RewriteCond %{REQUEST_URI} ^/admin
RewriteRule ^admin(.*) /backend/web/$1 [L]
# if a directory or a file of the frontend application exists, use the request directly
RewriteCond %{REQUEST_URI} ^/frontend/web
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward the request to index.php
RewriteRule . /frontend/web/index.php [L]
# if a directory or a file of the backend application exists, use the request directly
RewriteCond %{REQUEST_URI} ^/backend/web
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward the request to index.php
RewriteRule . /backend/web/index.php [L]
RewriteCond %{REQUEST_URI} \.(htaccess|htpasswd|svn|git)
RewriteRule \.(htaccess|htpasswd|svn|git) - [F]
</IfModule>
FUll configurations can be found at: https://github.com/mickgeek/yii2-advanced-one-domain-config

remove .html extension from url

I'm trying to remove the .html extension from url for my website by editing the .htaccess file under the web root(public_html) directory. My server is bluehost.
The problem is that I have previous settings in the .htaccess file already for the redirecting primary domain to a subdirectory purpose.
The script is below. Also with the script i found online for hiding the extension from url.(The script doesn't work) It will be really nice if someone can help me out with the problem. Thanks.
# Use PHP5.4 Single php.ini as default
AddHandler application/x-httpd-php54s .php
# BlueHost.com
# .htaccess main domain to subdirectory redirect
# Do not change this line.
RewriteEngine on
# Change example.com to be your main domain.
RewriteCond %{HTTP_HOST} ^(www.)?qinglish.ca$
# Change 'subdirectory' to be the directory you will use for your main domain.
RewriteCond %{REQUEST_URI} !^/qinglish_ca/
# Don't change the following two lines.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Change 'subdirectory' to be the directory you will use for your main domain.
RewriteRule ^(.*)$ /qinglish_ca/$1
# Change example.com to be your main domain again.
# Change 'subdirectory' to be the directory you will use for your main domain
# followed by / then the main file for your site, index.php, index.html, etc.
RewriteCond %{HTTP_HOST} ^(www.)?qinglish.ca$
RewriteRule ^(/)?$ qinglish_ca/index.html [L]
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]
Instead of your last rule you will need these rules to remove .html extensions fro all URLs:
## hide .html extension
# To externally redirect /dir/file.html to /dir/file
RewriteCond %{THE_REQUEST} \s/+(.+?)\.html[\s?] [NC]
RewriteRule ^ /%1 [R=302,L,NE]
# To internally forward /dir/file to /dir/file.html
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}/$1\.html -f [NC]
RewriteRule ^(.+?)/?$ /$1.html [L]
Place them at same place where you have current rule to add .html extension.