I want to rewrite
http://xxx.tld/member/profile/PARAMETER
to
http://xxx.tld/PARAMETER
How is this done in Codeigniter?
To rewrite use:
RewriteRule ^member/profile/PARAMETER$ /PARAMETER?&%{QUERY_STRING}
To redirect use:
Redirect 301 http://xxx.tld/member/profile/PARAMETER http://xxx.tld/PARAMETER
or try:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^member/profile/PARAMETER(.*)$ http://xxx.tld/PARAMETER$1 [r=301,nc]
Related
How can i redirect from www.example.com/dietitian/reema.verma.3 to www.example.com/dietitian/#/3 ? Please help.
Options +FollowSymLinks
RewriteEngine On
Redirect www.example.com/dietitian/reema.verma.3 www.example.com/dietitian/#/3
You can only match REQUEST_URI using RewriteRule or Redirect.
Use this rule:
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^/?(dietitian)/.+\.(\d+)/?$ /project/$1/#/$2 [L,NC,NE,R=301]
My redirection in my .htacces doesn't want redirect correct url.
DefaultLanguage fr-FR
Options -Indexes
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^clic_go\.php\?id=(.+)$ /clic.php?id=$1 [R=301,L]
He redirect to :
/?id=4
i want :
/clic.php?id=4
Any idea ?
Thanks you =D
Use:
RewriteEngine on
RewriteCond %{QUERY_STRING} (?:^|&)id=(.+)(?:&|$) [NC]
RewriteRule ^clic_go\.php$ /clic.php?id=%1 [NC,R=301,L]
Because query string is not in the RewriteRule url.
With all the query string, you can just do:
RewriteEngine on
RewriteRule ^clic_go\.php$ /clic.php [NC,R=301,L]
Because without addition, it is copied
All my site url reads
http://example.com/myfolder/main/other/extra/index.php
I want it to rewritten as
http://example.com/index.php
Try the below rule :
Options +FollowSymlinks
RewriteEngine on
rewriterule ^myfolder/main/other/extra/index.php(.*)$ http://example.com/index.php$1 [r=301,nc]
I want to rewrite my URL:
http://jainpopulationregister.com/page.php?action=about
to:
http://jainpopulationregister.com/page/action/about/
with URL rewriting
My current URL rewrite code is as follows:
Options +FollowSymLinks
RewriteEngine on
RewriteRule page/action/(.*)/ page.php?action=$1
RewriteRule page/action/(.*) page.php?action=$1
But when I place this in my root folder, nothing seems to happen. What am I doing wrong?
You want to redirect from
http://jainpopulationregister.com/page.php?action=about
to
http://jainpopulationregister.com/page/action/about/
but your redirect rule does exactly the opposite. Assuming that you really want to redirect from /page.php?action=about to /page/action/about/, use the following configuration in htaccess:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{QUERY_STRING} ^action=(.*)$
RewriteRule ^(.*)$ /page/action/%1/? [R=302,L]
RewriteRule ^page/action/([a-zA-Z0-9]+)/$ pages.php?action=$1 [NC,L]
In "pages.php" file get the action $_GET['action'];
I'm attempting to perform a simple 301 redirect via htaccess, the redirect works but adds "?folder=X" to the URL.
For instance:
Redirect 301 /pets http://www.mydomain.com/discount-pet-products
Returns:
http://www.mydomain.com/discount-pet-products?folder=pets
How do I remove this?
Here is my htaccess file
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
Redirect 301 /pets http://www.mydomain.com/discount-pet-products
RewriteRule ^([0-9a-zA-Z-]+)$ load.php?folder=$1 [L]
Try this:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^/pets$ http://www.mydomain.com/discount-pet-products? [R=301,L]
RewriteRule ^([0-9a-zA-Z-]+)$ load.php?folder=$1 [L]
Try this code:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^pets/$ /discount-pet-products? [R=301,L]
RewriteRule ^([0-9a-zA-Z-]+)/?$ load.php?folder=$1 [L,QSA]
Make sure to test this in a new browser to avoid browser caching issues.
The answer was placing redirect at top of .htaccess file, before anything
RewriteRule ^pets$ http://www.mydomain.co.uk/discount-pet-products [R=301,L]