Hiding page name following site URL
Re: Hiding page name following site URL
Hello again,
Yes, uploaded it as ASCII
Yes, .htaccess is visible
Yes, the Host company assured me it is supported
Yes, it is in the folder where I need it to do it
Yes, changed the permissions to 755
The host company send me a link to Stackoverflow to search for information
But - no luck...
Any other reason you can think of?
Yes, uploaded it as ASCII
Yes, .htaccess is visible
Yes, the Host company assured me it is supported
Yes, it is in the folder where I need it to do it
Yes, changed the permissions to 755
The host company send me a link to Stackoverflow to search for information
But - no luck...
Any other reason you can think of?
- BaconFries
-
- Posts: 5364
- Joined: Thu Aug 16, 2007 7:32 pm
Re: Hiding page name following site URL
Yes, they may support it but is it enabled by them? It needs to be enabled in the web server's main configuration file. I would contact them again and ask them have they enabled it in <Directory></Directory> and it's directives by changing "AllowOverride None" to "AllowOverride All' ( minus the quotes) when done the .htaccess should be working.Yes, the Host company assured me it is supported
Now on this
sorry for the shock but they should know how to set this as it is a web server configuration with them and for them to give you a link to search and find answers yourself is laughable (not at you but them) when it is really for them to help.The host company send me a link to Stackoverflow to search for information
Re: Hiding page name following site URL
BaconFries - Request permission to add a question (or rephrase the existing question)
Here is a link I found - https://www.rapidtables.com/web/tools/r ... rator.html. Thoughts on it's accuracy?
For a permanent 301 redirect solution on a Linux platform with GoDaddy, which is a better solution in your opinion?
htaccess:
# Permanent URL redirect - generated by www.rapidtables.com
Redirect 301 /about.html http://www.myurl.com/about/
or php:
<?php
// PHP permanent URL redirect - generated by www.rapidtables.com
header("Location: http://www.myurl.com/about/", true, 301);
exit();
?>
This is for a simple redirect from about.html to about/ without a change in domain name or host.
The following would be added to the htaccess file to hide the page extensions (from the WB12 program in options):
PHP EXTENTION REMOVAL
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
HTML EXTENTION REMOVAL
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]
I assume this is correct?
Here is a link I found - https://www.rapidtables.com/web/tools/r ... rator.html. Thoughts on it's accuracy?
For a permanent 301 redirect solution on a Linux platform with GoDaddy, which is a better solution in your opinion?
htaccess:
# Permanent URL redirect - generated by www.rapidtables.com
Redirect 301 /about.html http://www.myurl.com/about/
or php:
<?php
// PHP permanent URL redirect - generated by www.rapidtables.com
header("Location: http://www.myurl.com/about/", true, 301);
exit();
?>
This is for a simple redirect from about.html to about/ without a change in domain name or host.
The following would be added to the htaccess file to hide the page extensions (from the WB12 program in options):
PHP EXTENTION REMOVAL
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
HTML EXTENTION REMOVAL
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]
I assume this is correct?
The Website Guy - MN
Small Business Web Design
Small Business Web Design
- BaconFries
-
- Posts: 5364
- Joined: Thu Aug 16, 2007 7:32 pm
Re: Hiding page name following site URL
Hi Rob no permissions needed at all fire away. Both are just as good as each other and they do the same in the end. The PHP does requires the page extension to be .php were you can just add the .htaccess to the original file (if you already have one) and that's it.
Yes, you can also add further to it like the redirect, block allow IP address, Prevent Directory Listing, Block bots rven password it etc. With this said your host should support Apache and at the same time it needs to be enabled for it to work.The following would be added to the htaccess file to hide the page extensions (from the WB12 program in options):
Re: Hiding page name following site URL
Ok. I was also given this code to put in the htaccess file:
RewriteEngine On
RewriteBase /
RewriteRule ^/about/ /about.html
Redirect 301 /about.html /about/
Seems everyone (each "generator") has a different way to accomplishing this. Thoughts on the best way?
Also, if I am using redirects from nonwww to www as well as index.html to main url, is there a particular order all of this needs to be in?
I'll have to add in redirect from http to https another time...
In the end, I am simply wanting to learn how to 1 - hide page extensions (for security purposes right?) and 2 - ensure that if someone clicks on about.html in the search results they are successfully directing to the right page for about/. Wasn't there a big debate here on how best to accomplish this?
Thank you for the info. I'll have to call the host to ask if apache is supported and if "hide page extensions" is supported on my hosting plan.
RewriteEngine On
RewriteBase /
RewriteRule ^/about/ /about.html
Redirect 301 /about.html /about/
Seems everyone (each "generator") has a different way to accomplishing this. Thoughts on the best way?
Also, if I am using redirects from nonwww to www as well as index.html to main url, is there a particular order all of this needs to be in?
I'll have to add in redirect from http to https another time...
In the end, I am simply wanting to learn how to 1 - hide page extensions (for security purposes right?) and 2 - ensure that if someone clicks on about.html in the search results they are successfully directing to the right page for about/. Wasn't there a big debate here on how best to accomplish this?
Thank you for the info. I'll have to call the host to ask if apache is supported and if "hide page extensions" is supported on my hosting plan.
The Website Guy - MN
Small Business Web Design
Small Business Web Design
Re: Hiding page name following site URL
Baconfries,
Following your comments above, I contacted again my host company and they pointed me to conduct the tests listed in the following link:
https://docs.bolt.cm/3.4/howto/making-s ... is-working
I conducted the test, all seems fine so they concluded that the problem must be in my .htaccess script itself - which is outside the scope of their support.
Please remember - I am NOT looking for a redirect - just to have the original website showing in the search bar, without the actual pages...
Interestingly, this is exactly how it looks on my Samsung Galaxy phone (Android)... How do they do it?
Cheers
Alex
Following your comments above, I contacted again my host company and they pointed me to conduct the tests listed in the following link:
https://docs.bolt.cm/3.4/howto/making-s ... is-working
I conducted the test, all seems fine so they concluded that the problem must be in my .htaccess script itself - which is outside the scope of their support.
Please remember - I am NOT looking for a redirect - just to have the original website showing in the search bar, without the actual pages...
Interestingly, this is exactly how it looks on my Samsung Galaxy phone (Android)... How do they do it?
Cheers
Alex
- BaconFries
-
- Posts: 5364
- Joined: Thu Aug 16, 2007 7:32 pm
Re: Hiding page name following site URL
Hi Alex, I know that you are not looking for a redirect that answer was to Rob and not yourself.
Now in some instances you may need to use add "multiviews" to the .htaccess if this is the case then add the following to the top of the .htaccess
Example:
And for the removal of the page name and extension try.
Now in some instances you may need to use add "multiviews" to the .htaccess if this is the case then add the following to the top of the .htaccess
Code: Select all
Options +MultiViews
Example:
Code: Select all
<IfModule mod_rewrite.c>
Options -Multiviews
RewriteEngine on
RewriteBase /
RewriteRule ^(.+)\.html$ /$1 [R,L]
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*?)/?$ /$1.html [NC,END]
</IfModule>
And for the removal of the page name and extension try.
Code: Select all
<IfModule mod_rewrite.c>
Options -Multiviews
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(.*) index.php?$1 [L]
</IfModule>
Re: Hiding page name following site URL
Thaks man,
Not clear - do I need the TWO script segments to be in the .htaccess file ?
<IfModule mod_rewrite.c>
Options -Multiviews
RewriteEngine on
RewriteBase /
RewriteRule ^(.+)\.html$ /$1 [R,L]
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*?)/?$ /$1.html [NC,END]
</IfModule>
AND
<IfModule mod_rewrite.c>
Options -Multiviews
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(.*) index.php?$1 [L]
</IfModule>
Not clear - do I need the TWO script segments to be in the .htaccess file ?
<IfModule mod_rewrite.c>
Options -Multiviews
RewriteEngine on
RewriteBase /
RewriteRule ^(.+)\.html$ /$1 [R,L]
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*?)/?$ /$1.html [NC,END]
</IfModule>
AND
<IfModule mod_rewrite.c>
Options -Multiviews
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(.*) index.php?$1 [L]
</IfModule>
- BaconFries
-
- Posts: 5364
- Joined: Thu Aug 16, 2007 7:32 pm
Re: Hiding page name following site URL
No, please simply try each one to see what suits your needs and whatever works use. I don't know who you use for hosting but to be saying to you the customer "it is outside the scope of their support" I would be asking what do you support then as it is s server configuration and do you support this or not!. Right I am going to try and beat the a** out of Mr Insomnia to hopefully get some sleep.
Re: Hiding page name following site URL
Dear friend, I much appreciate your continous help
I tried the first segment and got the following error. The 2nd segment, I didn't try becasue it only refers to PHP
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@beleuramyhome.org.au and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
I tried the first segment and got the following error. The 2nd segment, I didn't try becasue it only refers to PHP
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@beleuramyhome.org.au and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.