htaccess is not properly working - .htaccess

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

Related

Remove directory on dynamic links with .htaccess

I wrote the following codes with .htaccess
RewriteRule ^articles/([0-9a-zA-Z-_]+)$ page.php?article_seolink=$1 [NC,NE,L]
And I created the following URL address
example.com/articles/article-title
But I want to create a link like
example.com/article-title
How can I do this and redirect old URL to new one?
With your shown samples, please try following rules. Please make sure to place your htaccess Rules file inside articles folder. Please make sure to clear your browser cache before testing your URLs.
RewriteEngine ON
RewriteRule ^([0-9a-zA-Z-_]+)$ page.php?article_seolink=$1 [NC,NE,L]

Redirect the URL using .htaccess

I have a page showing the products with the hyperlink for it as
www.domainname.com/productname
now my client needs to add store and needs the URL to show as
www.domainname.com/store/productname
I have done it via code and now when I click on it for a detail page, its still redirecting to
www.domainname.com/productname
but need to be
www.domainname.com/store/productname
tried with this: RewriteRule ^store/?$ domina.com/?$ [NC,L] in .htaccess file, not sure whether I'm on page
Can any one tell me how to do it via .htaccess file.
Thanks in advance.
Try this :
RewriteRule ^store/(.*)/?$ http://domain.com/store/$1 [R,L,NC]

htaccess URL rewrite issue - permalinks

I am having some issues trying to prettify some URL's. Basically I need to make this URL http://domain.com/actualfolder/fakepath/this-is-the-article.php to display content from this page http://domain.com/actualfolder/articlemanager.php.
The articlemanager.php is setup to receive a GET url variable in the way of the "this-is-the-article" and search for it in the database. If found, it will display content specific to that result. This part works.
The part that i can't make it to work is the htaccess rule.
This is my rule but it returns 404 not found or 500 if i don't use the initial slashes.
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^fakepath/([^/.]+).php$ articlemanager.php?permalink=$1 [L]
I could really use some help, so any suggestion is welcome.
EDIT: the htaccess file lies in the domain.com/actualfolder/ location

URL Masking!With Htaccess

I'm quite new here so i have a problem about masking and tried other solutions using .htaccess as well but no luck, that's why im here. Thanks.
Ok here's it is:
I want my http://www.domain.com/article-tip to show in http://www.subdomain.domain.com
It means the page content is from: domain.com/article-tip
But the url above the address is: subdomain.domain.com
How would i do that using .htaccess?
It means i also tried the iframe and frames and php, but i want the .htaccess
Thanks in advance.!
you can use mod_rewrite in that case the URL will be subdomain.domain.com/article-tip but in php URL will be www.domain.com/article-tip.
I don't think you can send dynamic output to browser like what you want with .htaccess
This should work for what you need to get all files in article-tip to point to the subdomain. The subdomain should also point to the subdirectory. This is for the .htaccess of the subdirectory.
RewriteRule ^article-tip(.*)$ http://subdomain.domain.com [R=301,L]
RewriteRule ^article-tip/(.*)$ http://subdomain.domain.com/$1 [R=301,L]

.htaccess for cakephp

I am runing a site wishberry.in on cakephp framework. I had some dirty URLs previously and now i want them to cleanup through .htaccess
I original url was wishberry.in/createwishlist3 and i want to change that to wishberry.in/brands with a 301 redirect.
The reason for using 301 is, if someone type wishberry.in/createwishlist3, the page will take them to /brands automatically.
Can anyone help me out what to write in my .htaccess file.
I would recommend doing this with routes in CakePHP rather than the .htaccess file. See http://bakery.cakephp.org/articles/Frank/2009/11/02/cakephp-s-routing-explained for more details.
The following should do the trick:
RewriteEngine On
RewriteRule ^createwishlist3$ /brands [R=301,L,NC]
Hope this helps.

Resources