• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Help .htaccess

kadeshop

New Member
Joined
May 1, 2013
Messages
33
Reaction score
0
Hello i have problem. I using htaccess in my website. And i change windows server to ubuntu, and my .htaccess dont working.

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?nameserver\.pl [NC]
RewriteRule (.*) http://nameserver.pl/$1 [R=301,L]
RewriteCond %{REQUEST_URI} ^https://nameserver.pl/login.php
RewriteCond %{QUERY_STRING} VARIABLE=VALUE
RewriteRule ^(.*)$ https://nameserver.pl/login.php? [R=301,L]


i have on nameserver.pl dont firewall cloudflare and all connecting using subdomain
i have login.php on official website (but regule dont working, i want nameserver.pl/login.php dont change website) anyone can help me ?
I using ubuntu 18.04
 
On my mind this have non-sense. But trying to understand the real sense of this hahahaha
me:

source.gif


Why you're using Redirect flag? o_O

Probably something like this will work for you.

Perl:
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{SERVER_NAME} =yourDomain.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

#If you want only www. sub-domain, use the code part with regex ^? like you did.

RewriteRule ^login/(.*)$ login.php?yourParams=$1 [NC]
RewriteRule ^login login.php

#or can you make a big general stupid request using file name.
#RewriteRule ^(.*)$ $1.php [NC]

ErrorDocument 500 "https://www.yourDomain.com"
ErrorDocument 503 "https://www.yourDomain.com"
ErrorDocument 404 "https://www.yourDomain.com"
ErrorDocument 401 "/index.php"
ErrorDocument 403 "https://www.yourDomain.com"
 
Ok this is how. Ubuntu doesn't show the file. the file is there but it doesn't show it. The best way to do it is to add another file on top of that one and replace it..

Have a text.file with the changes you want to do to the htaccess file

Install "Visual studio code" on ubuntu (is what i use for coding)
You can also use notepad++.

Open the text.file with the coding program on ubuntu. Hit "save as" name it ".htaccess" and save it. It will ask you if you want to replace it. Hit replace and done.

Make sure its saved in the htdocs folder


I hope it helps.
 
Last edited:
Back
Top