.htaccess
Posted: Fri May 11, 2018 7:49 am
Good day
I have recently installed the Yellow Pages script from PHPJabbers. On the following domain www.wb-sa.co.za and with the help of another WWB user protectourlands managed to integrate everything into an index.php file created with Wb14.
I must stress that everything is working and there is no issues regarding the integration part. The problem that I am having is something else, and by way of Google search narrowed it down to my .htaccess file on the server. That is of course possible that I may be mistaken.
My problem is:
When a user creates an account he must at some point supply his website URL in the following format http://www.demo.com. However, some people just enter www.demo.com (without the http://) part. Some systems would tell the user to either use the correct format or add the http:// by default, but the scrip that I am using does not cater for such an event.
This means that when you hover over the link in the listing the web browser will show that the link is pointing to http://wb-sa.co.za/www.demo.com instead of http://www.demo.com.
My Google research point me to a how to redirect non www to www searching and suggest I add the following PHP code to my .htaccess file https://stackoverflow.com/questions/120 ... n-htaccess
So I entered the following code:
# Redirect to www
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTPS}s on(s)|offs()
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [NE,L,R]
Unfortunately this does not seem to work.
To see the problem in action please follow the link and proceed to click on the www.google.com link that is there. http://www.wb-sa.co.za/index.php?contro ... nView&id=6
Does someone have any suggestions.
Regards
Riaan
I have recently installed the Yellow Pages script from PHPJabbers. On the following domain www.wb-sa.co.za and with the help of another WWB user protectourlands managed to integrate everything into an index.php file created with Wb14.
I must stress that everything is working and there is no issues regarding the integration part. The problem that I am having is something else, and by way of Google search narrowed it down to my .htaccess file on the server. That is of course possible that I may be mistaken.
My problem is:
When a user creates an account he must at some point supply his website URL in the following format http://www.demo.com. However, some people just enter www.demo.com (without the http://) part. Some systems would tell the user to either use the correct format or add the http:// by default, but the scrip that I am using does not cater for such an event.
This means that when you hover over the link in the listing the web browser will show that the link is pointing to http://wb-sa.co.za/www.demo.com instead of http://www.demo.com.
My Google research point me to a how to redirect non www to www searching and suggest I add the following PHP code to my .htaccess file https://stackoverflow.com/questions/120 ... n-htaccess
So I entered the following code:
# Redirect to www
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTPS}s on(s)|offs()
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [NE,L,R]
Unfortunately this does not seem to work.
To see the problem in action please follow the link and proceed to click on the www.google.com link that is there. http://www.wb-sa.co.za/index.php?contro ... nView&id=6
Does someone have any suggestions.
Regards
Riaan