.htaccess viewing/using problem

Status
Not open for further replies.

denis.bosma61

New Member
Messages
10
Reaction score
0
Points
0
Hi guys,
So I have a problem with using .htaccess on my site, I can't see it in my file manager and if I am trying to use one I'll get an 404 error
Regards,

Denis Bosma
 

Gouri

Community Paragon
Community Support
Messages
4,565
Reaction score
245
Points
63
Hi guys,
So I have a problem with using .htaccess on my site, I can't see it in my file manager and if I am trying to use one I'll get an 404 error
Regards,

Denis Bosma


The .htaccess is hidden file. So when you are opening the Filemanager, select the tickmark "Show hidden files"

Then you can see it in your public_html folder.
 

denis.bosma61

New Member
Messages
10
Reaction score
0
Points
0
Alright that's ok but...
I have an phpbb forum and when I'm adding this to the /adm folder I've got an 404 ?

Code:
<Files 403.shtml>
order allow,deny
allow from all
</Files>

allow from my-ip
deny from all
 

Gouri

Community Paragon
Community Support
Messages
4,565
Reaction score
245
Points
63
Alright that's ok but...
I have an phpbb forum and when I'm adding this to the /adm folder I've got an 404 ?

Code:
<Files 403.shtml>
order allow,deny
allow from all
</Files>

allow from my-ip
deny from all

Actually What you want to do?

You want to allow only your ip to access adm folder

then add this

Code:
order deny,allow
deny from all
allow from xxx.xxx.xxx.xxx

Where xxx.xxx.xxx.xxx is your ip.
 

denis.bosma61

New Member
Messages
10
Reaction score
0
Points
0
Alright thumbs up on that one, what about this:
I'm trying this
Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([A-Za-z0-9\-\+]+)$ ./page.php?p=$1 [L]

And this is what I get

neg76a.png




BTW, @gsonline it's not working again...
 
Last edited:

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Try:

Code:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([A-Za-z0-9\-\+]+)$ page.php?p=$1 [L]

Also, by "not working", do you mean the IP block?
 

denis.bosma61

New Member
Messages
10
Reaction score
0
Points
0
Also, by "not working", do you mean the IP block?
Yep...


Screenshot-3.png
This is after your code witch is
Code:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([A-Za-z0-9\-\+]+)$ page.php?p=$1 [L]
 
Last edited:

Gouri

Community Paragon
Community Support
Messages
4,565
Reaction score
245
Points
63

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
1. Got a URL that throws the 500 error?
2. Where is the .htaccess located?
3. Where is page.php located?

I'll get to the IP block in a minute.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
RewriteBase /admin/
RewriteCond %{HTTP:X-Forwarded-For} !^130\.65\.11\.68$ <-- Substitute your IP
RewriteRule ^(.*)$ 403.html [L]

If you are trying to protect/block the /admin directory
Just create a 403.html (Forbidden) file in the directory and have others sent there.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
That link throws a 404 Not Found error, not a 500 error.
 

denis.bosma61

New Member
Messages
10
Reaction score
0
Points
0
If my .htaccess is like this
Code:
#<IfModule mod_rewrite.c>
#RewriteEngine on
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#</IfModule>

<Files "config.php">
Order Allow,Deny
Deny from All
</Files>

<Files "common.php">
Order Allow,Deny
Deny from All
</Files>


RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([A-Za-z0-9\-\+]+)$ ./page.php?p=$1 [L]
it will be an 500

but if it's like this
Code:
#<IfModule mod_rewrite.c>
#RewriteEngine on
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#</IfModule>

<Files "config.php">
Order Allow,Deny
Deny from All
</Files>

<Files "common.php">
Order Allow,Deny
Deny from All
</Files>


RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([A-Za-z0-9\-\+]+)$ ./page.php?p=$1 [L]
it will be an 404
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Since neither is what I told you to do, goodday.
 
Status
Not open for further replies.
Top