I want to replace:
/search/my+query
Then, the url will be redirected to:
/download/my-query
anybody can help me? im using wordpress, and i expects the code can be work in .htaccess.
Related
In my root directory I have files but I want the rewrite to work only if there is a slash.
I have urls at the moment as www.mysite.com/index.php?id=10&id1=234. I want instead to have urls like www.mysite.com/234 that rewrite to passthrough.php?id=234.
I will use php to redirect. The important point is the rewrite should only happen if there is a slash so it does not conflict with other stuff.
Thanks in advance!
I have sorted this out now thanks by simply looking at the rewrite template and all works fine. It can be a bit confusing when you first use such things!
I need help from experts to solve my problem. I'm just starting to learn rewriterule, rbase, and rcond. I want to rewrite my site link like codeigniter MVC. For example:
http://localhost/app/index.php?page=profile&user=john -> http://localhost/app/index/page/profile/user/john
How to do that? I tried to change for many times, but i don't get url like that but error occured.
RewriteRule ^index/page/(.*)/user/(.*)$ /index.php?page=$1&user=$2 [L]
Iam trying to redirect the url
mysiteurl/489b2af630dda933d521088d0/Salman%20Khan
to
mysiteurl/showImage.php?ik=489b2af630dda933d521088d0.
1) Please help me to write the htaccess code
2) Is there any way to use the url as mysiteurl/Salman%20Khan. I mean I would like to hide the image key in the url .
I think you should add the bolded string to your .htaccess file
RewriteEngine On
RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+|(*.css)$ showImage.php?ik=$1&title=$2
i am using the rewrite rules in htaccess but i am getting error on site,
while adding a / (slash) into the link
My Example Code:
RewriteEngine On
RewriteRule ^categories/(.*)$ ?act=directory&category=$1 [L]
actually i want to call this link from the category listing where the href link is
categories/category-name
now if i call this link like this
categories-category-name
then it works fine, but if i add the slash then the site looks as it doesnt have the css :(
only unstyled text i can see.
Thanks In Advance
Please Advise.
You need to add a slash in your css path
href="/css/your_style_name.css"
This will work
I have a link from anther website that I do not have control of http://example.com/one two three.exe
The correct URL is http://example.com/one_two_three.exe
Note the underscores instead of spaces.
I searched the internet and found this code snippet for .htaccess
# Redirect old file path to new file path
Redirect /one%20two%20three.exe http://example.com/one_two_three.exe
I added this snippet to my preexisting root .htaccess at the top of the file.
But it does not seem to work. My browser does not redirect and I get a 404 error page.
I believe that it has something to do with the spaces in the original URL but I don't know how to handle spaces in the URL.
Suggestions?
You could try a couple of things (both untested)
Redirect "/one two three.exe" http://example.com/one_two_three.exe
or use RewriteRule instead of Redirect:
RewriteRule /one\ two\ three.exe http://example.com/one_two_three.exe