From this:
http://ice-phoenix.dx.am/jlpt/form/try_question.php
To This:
http://ice-phoenix.dx.am/jlpt/try_question
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^jlpt/form/try_question\.php$ jlpt/try_question/ [L]
Can any help me?
Thank you so much.
Try this in Root/.htaccess file
RewriteEngine On
RewriteCond %{THE_REQUEST} /jlpt/form/([^.]+)\.php [NC]
RewriteRule ^ /jlpt/%1? [R,L]
RewriteRule ^jlpt/([^/]+)/?$ /jlpt/form/$1.php [L,NC]
Related
I'm trying to rewrite matching URLs of my website but it's not working for some reason, don't know why...
Here is current URL:
example.com/details.php?p=10&text=some-text-is-here
want to write like this
example.com/post-details/10/some-text-is-here
My .htaccess is here
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{THE_REQUEST} \s/details\.php\?id=([0-9]+)\s [NC]
RewriteRule ^ /details/%1? [R=301,L]
RewriteRule ^details/([0-9]+)$ /details.php?id=$1 [L]
any help would be appreciated
Try this :
RewriteEngine On
RewriteCond %{THE_REQUEST} \s/details\.php\?p=(\d+)&text=(.+)\s [NC]
RewriteRule ^ /post-details/%1/%2? [R=301,L,NE]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\.jpg$
RewriteRule ^post-details/(\d+)/(.+)$ /details.php?p=$1&text=$2 [L,NE]
Note: clear browser cache the test
How can I change
www.example.com/index.php?page=2_4_home
to
www.example.com/2/4/home
or
www.example.com/2/4/home/
with htaccess? Thanks
Try
RewriteEngine on
RewriteRule ^([0-9]+)/([0-9]+)/([a-zA-Z]+)/?$ /index.php?page=$1_$2_$3 [L]
Try:
RewriteEngine On
RewriteCond %{THE_REQUEST} \ /+(?:index\.php|)\?page=([0-9]+)_([0-9]+)_([^&\ ]+)
RewriteRule ^ /%1/%2/%3/? [L,R]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([0-9]+)/([0-9]+)/([^/]+)/? /index.php?page=$1_$2_$3 [L,QSA]
I want to redirect
http://www.mysite.com/index.php?channels=browse&channel_id=1&sort=rated
to
http://www.mysite.com/category/cars/?r_sortby=highest_rated&r_orderby=desc
Can someone to help-me with this issue?
Thank you!
This should work for you
RewriteEngine on
RewriteCond %{THE_REQUEST} ^(GET|POST)\ /index\.php\?channels=browse&channel_id=1&sort=rated\ HTTP
RewriteRule ^ /category/cars/?r_sortby=highest_rated&r_orderby=desc? [R=301,L]
EDIT:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/category/(.*)
RewriteRule ^(.*)$ /watch.php?tag=$1 [L]
I have this code, it redirecs www.example.com?index.php?q=home&lang=en into www.example.com/home. I would like to redirect it into www.example.com/en/home. Is it possible?
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)$ index.php?q=$1&lang=$2 [L,QSA]
RewriteRule ^([^/]*)(.*)$ $1[L,QSA]
Thanks in advance
Try:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z]{2})/(.*)$ /index.php?q=$2&lang=$1 [L,QSA]
I am trying to redirect http://test.pearlsquirrel.com/explore_all?u=hiphop to http://test.pearlsquirrel.com/explore_all/hiphop using htaccess. However, It keeps redirecting here: http://test.pearlsquirrel.com/explore_all/?u=site_error.php. I have looked all over Stackoverflow for the answer but I just can't seem to find it. I would really appreciate some help in fixing this problem, thanks!
Here is my .htaccess file
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.pearlsquirrel.com$ [NC]
RewriteRule ^(.*)$ http://pearlsquirrel.com/$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^([^/]+)/$ $1.php
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+) explore_all?u=$1 [L]
You may try this:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{QUERY_STRING} [^=]+=([^=]+)
RewriteRule .* /%1? [L]
Will map this:
http://test.pearlsquirrel.com/explore_all?u=hiphop
To this:
http://test.pearlsquirrel.com/explore_all/hiphop
Replace the corresponding code in your .htaccess file with this one.
I have not checked the rules in your .htaccess file.
OPTION
Now, if it is the other way around, which I think it is, and the idea is to map this incoming URL:
http://test.pearlsquirrel.com/explore_all/hiphop
To this resource:
http://test.pearlsquirrel.com/explore_all?u=hiphop
Replace the above rule set with this one:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} .*/([^/]+)/?
RewriteRule .* http://test.pearlsquirrel.com/explore_all?u=%1 [L]