.htaccess, URL rewriting using mod_rewrite
Mod_rewrite is available at OVH on all web hosting packages (apart from 20gp packages)
Mod_rewrite is available at OVH on all web hosting packages (apart from 20gp packages)
RewriteEngine On
RewriteRule .* testing.php
This code redirects each request to the testing.php script.
RewriteEngine On
RewriteRule letstest /test_wslash/testing.php
This code redirects each /letstest request to the /test_wslash/testing.php script.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com$
RewriteRule ^(.*) http://www.example.com/$1 [QSA,L,R=301]
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com
RewriteCond %{REQUEST_URI} !^/MySite
RewriteRule ^(.*)$ /MySite/
mod_rewrite enables URL rewriting
RewriteEngine On
RewriteCond %{REQUEST_URI} !testing.php
RewriteRule (.*) testing.php?var=$1
These rules run the testing.php script with the GET variable containing the URL.
<?
print("testing server <br/>\n");
print("var: {$_GET['var']}\n");
?>
The mod_rewrite module enables you to rewrite URLs.
RewriteEngine on
Rewritecond %{HTTP_HOST} ^domain_name.tld$
Rewriterule ^(.*) https://ssl5.ovh.net/~login_ftp/$1 [QSA,L,R=301]
RewriteEngine on
RewriteCond %{HTTP_HOST} ^nom_domaine.tld$
RewriteCond %{REQUEST_URI} ~094/page.php
RewriteRule ^(.*) https://ssl5.ovh.net/~login_ftp/$1 [QSA,L,R=301]
To find out all about the .htaccess file: Click here
Please feel free to give any suggestions in order to improve this documentation.
Whether your feedback is about images, content, or structure, please share it, so that we can improve it together.
Your support requests will not be processed via this form. To do this, please use the "Create a ticket" form.
Thank you. Your feedback has been received.
Access your community space. Ask questions, search for information, post content, and interact with other OVHcloud Community members.
Discuss with the OVHcloud community