.htaccess URLs title in url not by id - php

I am trying tyo change my url address by title, doing change by id its work and show all the content but when trying by title its not show content
the .htaccess code is
RewriteRule ^blogview/([-a-zA-Z]+) single1.php?title=$1 [L,QSA]
and the page code is
<a class="bttn" href="/blogview/<?php echo $row['title']; ?>">MORE</a>
the link of url is Page link

Change the rule as following:
RewriteRule ^blogview/([A-Za-z\-]*)$ single1.php?title=$1 [L,QSA]

Related

Remove file name “specification.php?url=” from url

This is a link on index.php page
<?= $mbbelow['brand_name']; ?><?= $mbbelow['title']; ?>
from this link I come on page specification.php
then this url come http://www.themobilesapp.com/specification.php?url=Sony-Xperia-Z5-specifications-5246.php
in the base of url I find all data of page.
This url is not proper according to me.
Here I want to remove specification.php?url= from this above url.
Please tell me in proper and full explain way that how to remove and make new url like this
http://www.themobilesapp.com/Sony-Xperia-Z5-specifications-5246.php
I only need .htaccess or I also need to work using php code to remove this.
I will provide you all details you need here for to remove this.
Please try this in .htaccess file:
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ specification.php?url=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ specification.php?url=$1

htaccess send content after ? as a parameter

This is my input URL
http://site_name/project/edit/sgdsg/getFile/?file=271bbec45d7855a332e6dfda85ca94b9.txt
I want it to be sent like
http://site_name/project/edit/sgdsg/getFile/271bbec45d7855a332e6dfda85ca94b9.txt
How can we do this? I want this only for the URL starting with http://site_name/project/edit/sgdsg/getFile/
So it don't affect any other URL.
This is what I have tried ...
RewriteRule ^project/edit/([A-Za-z0-9._-]+)/([A-Za-z0-9._-]+)/([A-Za-z0-9._-]+)/?$ modules-nct/edit_project-nct/index.php?slug=$1&action=method&method=$2&file=$3 [L]
RewriteRule ^project/edit/([A-Za-z0-9._-]+)/([A-Za-z0-9._-]+)/?$ modules-nct/edit_project-nct/index.php?slug=$1&action=method&method=$2 [L]
RewriteRule ^project/edit/([A-Za-z0-9._-]+)/?$ modules-nct/edit_project-nct/index.php?slug=$1 [L]
Please don't give it negative ratings just because my editing is improper.I am here to learn something new.
Thanks.
In your <a> tag:
<a href="your_url/your_other_parameters(means :project/edit/sgdsg/getFile/ )/directly enter your file name that you want to pass"> i.e your <a> tag must be
In htaccess:
RewriteRule ^project/edit/([A-Za-z0-9._-]+)/([A-Za-z0-9._-]+)/([A-Za-z0-9._-]+)$ modules-nct/edit_project-nct/index.php?slug=$1&action=method&method=$2&file=$3
In the above line, the href URL will be redirected to an original URL.

title redirecting in htaccess for redirecting url or something like this

i want to redirect this please guide me
form
http://example.com/babycare/general_help/category.php?id=10
to
http://example.com/babycare/article/category/10
the id should change deynamicly i.e id may b 10,12,or 23 etc
Blockquote
Try use on .htaccess:
RewriteRule ^babycare/article/category/([0-9]+)$ babycare/general_help/category.php?id=$1
try this one, you need to change some part of it accoriding to your category
RewriteEngine On
RewriteRule ^category/(.+)/(.+)$ category.php?$1=$2 [NC,L]

htaccess: RewriteRule for URL rewriting

I have a link that looks like this
http://www.example.com/artistmusic?address=JKanyomozi
I would like to change this URL to
http://www.example.com/JKanyomozi/music
I've only been able to do this by adding music as a parameter instead of adding it to the new URL as a prefix.
In short, i've turned this URL ...
http://www.example.com/artistmusic?address=JKanyomozi&req=music
... using this rule ...
RewriteRule ^([^/]*)/([^/]*)$ /artistmusic?address=$1&req=$2 [L]
... into ...
http://www.example.com/JKanyomozi/music
But the problem with this is that for other pages like the one for the videos, this rule redirects to the same page http://www.example.com/JKanyomozi/music instead of http://www.example.com/JKanyomozi/videos
The videos page's original URL is something like this ...
http://www.example.com/artistvideos?address=JKanyomozi
Which rule can I use to change the URL above to
http://www.example.com/JKanyomozi/videos
This applies for other pages like artistevents, artistphotos and artistbiography
Thank you in advance!
Try this :
RewriteRule ^([^/]*)/([^/]*)$ /artist$2?address=$1 [L]

PHP - Remove the Specific Segment from URL

I have showing the ad banners in .../openx/banner.php
Each Banner I had set the Banner Link.
After clicking the Banners the Page is redirected with the following URL.
.../openx/www/delivery/ck.php?oaparams=2__bannerid=1__zoneid=1__cb=5b97a864fe__oadest=http%3A%2F%2Fwww.google.com
Here is the root URL : openx/
I want to remove the last segment that is oadest=http%3A%2F%2Fwww.google.com when the page is loaded.
Please anyone help me...
Thanks...
Assuming this string is always at the end of your url, try putting this in the appropriate place on your .htaccess file:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^(.*)oadset=(.*)$
RewriteRule ^/?ck\.php$ /ck.php?%1 [L]

Categories