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]
Related
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
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.
I have facing a problem is when the url is http://localhost/admin/add_department/11 then I clicked a button which under same folder and will go to general_setting.php but the url will became http://localhost/admin/add_department/general_setting and still at add_department page ,
I want it became http://localhost/admin/general_setting,
this is my current .htaccess file content
RewriteEngine On
RewriteBase /
RewriteRule ^(admin)/([\w-]+)/([\w-]+)/?$ test/application/$1/$2.php?action=edit&department_id=$3 [L,QSA,NC]
RewriteRule ^(admin)/([\w-]+) test/application/$1/$2.php [L,QSA,NC]
http://localhost/admin/general_setting is work under my current .htaccess file,how to redirect http://localhost/admin/add_department/11 to http://localhost/admin/general_setting
thanks~
Only the server knows your folder structure. So if you want to go from http://localhost/admin/add_department/11 to http://localhost/admin/general_setting you should make your link point to ../general_setting instead of just 'general_setting'.
Update
A second option is to make all URLs relative to the domain. So if you want to go to http://localhost/admin/add_department/11. You make the link /admin/add_department/11 and if you want to go to http://localhost/admin/general_setting you make the link /admin/general_setting. The slash on the beginning means that it has to look from the domain you're on.
You might have to set a base tag depending on your situation.
<base href="http://localhost">
Documentation of base tag
I am having a severe problem and have no clue about what is going on... I will specify the general issue which is causing multiple issues on this Wordpress powered portal.
Steps to reproduce:
Visit the URL: http://gamersgeographic.com/en/ (or any post on this site)
Append #abc or #anything to the URL
The URL tries to resolve for a second and magically deletes the "#" and instead changes to /abc or /anything , which of course does not exist and gives a 404 page not found.
Even if the local anchor with #abc exists, behaviour is the same.
Now, consider the case below:
Visit http://gamersgeographic.com/monster-hunter-diary-1/
Comment link appends a #comments or #respond depending on whether a comment is there or not.
Both the anchors exist on the single post page
Still it redirects after finding them, to /comments and gives 404
Direct URL with #comments works e.g. http://gamersgeographic.com/monster-hunter-diary-1/#comments works but when I change any base URL to #comments, it redirects to 404...
I have tried several combinations with Permalinks, so it is not a problem with that. I even wrote my own Comment link generator in php with just a plain
href="#comments"
but still no luck...
If you need any further information about any function's code in theloop.php or anything please let me know.
Thanks in advance !
Regards
The contents of .htaccess are as below:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
This is not a PHP issue, it is Javascript: it is evident when you reproduce it, and you can test it by disabling Javascript and adding #comments at the end of the URL; it will work.
Now, I have done some work for you, and the culprit is a Javascript file aptly named hashchange.js. Look, for example, at this line:
function second_passed() {
if(current_page!=location.href {
get_page_by_hash(location.href);
}
setTimeout(second_passed,1000);
}
Which explains why you see it “working” for a second.
And here is the redirect:
jQuery(window).hashchange(function() {
var link = window.location.hash.replace("#", "");
get_page_by_hash(link)
});
Note that hashchange is a method for event handling available in jQuery Mobile.
<link rel="canonical" href="URL OF YOUR HOMEPAGE HERE>
add this in your header.php in <head></head> section and then try . it shouldn't be giving 404 error !
The way that page bookmarks are used is, as you know, the href="" of an anchor points to an #some-place. In order for this to happen #some-place must be the id of the element within the page you wish to go to.
For example:
http://gamersgeographic.com/monster-hunter-diary-1/#respond
should take you to the element with id="respond" in that page.
If the element with that ID doesn't exist you won't be able to travel to it, and may be the reason it results in a 404 Not Found. However, if the element does indeed exist on the page with the proper ID and it still redirects to a 404 then you may want to check your web server configuration to make sure it isn't filtering the # in some way.
I want to make my URL clean. Below is what I want to do:
Dirty URL: www.site.com/index.php?page=products
Clean URL: www.site.com/products/
For this, I write these codes in .htaccess file:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^([^/]*)/$ /index.php?page=$1
But whenever I click on the links in my project, I redirect to localhost page. Links are in this form:
Products
I think it may be related to href value.
What's the correct form for href value? href="product",href="/product/",etc. ?
There is no correct form for your href attribute, each form acts in different ways:
Products
The above would go relatively from the page you are currently on, so might be domain.com/products but might be domain.com/shop/products
You are better using a link direct from the root by using a / at the start, for example:
Products
would go to domain.com/products (note the lack of a / at the end of the url, which will make it not work with your current htaccess rule)
To make both /products and /products/ go to the correct place, change your htaccess rule to:
RewriteRule ^([^/]*)/?$ /index.php?page=$1
The ? will make the character preceding it optional, so the / in this case.