[solved] .htaccess when host doesn't support 301 redirect
Posted: Fri Aug 05, 2011 6:04 pm
Dear all
A new client on new host has raised the following issues - they don't support 301 re-direct in .htaccess.
So currently all it has as they have supplied is:
RewriteEngine on
RewriteOptions inherit
RewriteBase /bin-cgi/
RewriteRule ^\.cgi$ - [T=application/x-httpd-cgi]
And my config has
#------------
#URL Settings
#------------
#What type of URL rewriting should we be using for pretty URLs? Valid options are:
#'none', 'internal', and 'mod_rewrite'. 'internal' will not work with IIS some CGI
#configurations. 'mod_rewrite' requires proper apache configuration, a valid
#.htaccess file and most likely {metadata} in your page templates. For more
#information, see:
#http://wiki.cmsmadesimple.org/index.php ... ty_URL.27s
$config['url_rewriting'] = 'internal';
#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '.html';
#If you're using the internal pretty url mechanism or mod_rewrite, would you like to
#show urls in their hierarchy? (ex. http://www.mysite.com/parent/parent/childpage)
$config['use_hierarchy'] = true;
#If using none of the above options, what should we be using for the query string
#variable? (ex. http://www.mysite.com/index.php?page=somecontent)
$config['query_var'] = 'page';
This gets me to urls as follows:
http://www.webaddress.co.uk/index.php/contact-us.html
When what I really need is:
http://www.webaddress.co.uk/contact-us.html
Can anyone shed any light on what I can add to my .htaccess to achieve this? I also need to allow forms to get through using Formbuilder.
Site details - running 1.9.4.2 with only Gallery and Formbuilder modules added to standard install.
A new client on new host has raised the following issues - they don't support 301 re-direct in .htaccess.
So currently all it has as they have supplied is:
RewriteEngine on
RewriteOptions inherit
RewriteBase /bin-cgi/
RewriteRule ^\.cgi$ - [T=application/x-httpd-cgi]
And my config has
#------------
#URL Settings
#------------
#What type of URL rewriting should we be using for pretty URLs? Valid options are:
#'none', 'internal', and 'mod_rewrite'. 'internal' will not work with IIS some CGI
#configurations. 'mod_rewrite' requires proper apache configuration, a valid
#.htaccess file and most likely {metadata} in your page templates. For more
#information, see:
#http://wiki.cmsmadesimple.org/index.php ... ty_URL.27s
$config['url_rewriting'] = 'internal';
#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '.html';
#If you're using the internal pretty url mechanism or mod_rewrite, would you like to
#show urls in their hierarchy? (ex. http://www.mysite.com/parent/parent/childpage)
$config['use_hierarchy'] = true;
#If using none of the above options, what should we be using for the query string
#variable? (ex. http://www.mysite.com/index.php?page=somecontent)
$config['query_var'] = 'page';
This gets me to urls as follows:
http://www.webaddress.co.uk/index.php/contact-us.html
When what I really need is:
http://www.webaddress.co.uk/contact-us.html
Can anyone shed any light on what I can add to my .htaccess to achieve this? I also need to allow forms to get through using Formbuilder.
Site details - running 1.9.4.2 with only Gallery and Formbuilder modules added to standard install.