http://localhost/omsi_site/blogs.html?title=Responsive%20web%20design
I want to remove blogs.html?title= from this url using htaccess.
With this code your path will be /blogs:
RewriteEngine On
RewriteBase /omsi_site/
RewriteRule ^blogs$ blogs.html?title=Responsive%20web%20design [L]
•Log into your cPanel.
• Find the Files category and click on the File Manager icon.
• In the top right hand corner, click on Settings. For the primary domain, click on the Web Root radio button. For addon domains, click on the dropdown and find your desired addon domain name. Be sure the checkbox next to Show Hidden Files is checked. Click the Save button to return to the main File Manager screen.
• You should now be in the root folder of the domain you chose. Look for the .htaccess file and right click on it. This brings up a menu. Find and click on the Edit option. If you get a popup box, simply find and click the Edit button in the lower right corner to continue to the editor.
• You are now in the text editor
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
Paste the code and save !
Related
I have a problem similar to this, but changing the .htaccess file hasn't solved my problem.
I have addressed this issue by including the following two rules into my .htaccess file. It now correctly redirects any http requests without the www prefix, to the page with it. The problem now is that google is still displaying the site without the prefix. The homepage is showing on google with the www. prefix, but not other pages.
RewriteCond %{HTTP_HOST} ^websitename.com [NC]
RewriteRule ^(.*)$ http://www.websitename.com/$1 [L,R=301]
Use Google Search Console:
Specify a preferred domain: On the Search Console Home page, click the
site you want. Click the gear icon , and then click Site Settings. In
the Preferred domain section, select the option you want.
Set your preferred domain (www or non-www)
I got an error with SEO linking..
this is what happens..
http://boznetwork.net/index.php?a=explore
If you click on a track (not the play button) but if you click on the title of the track. The orange load bar will not redirect you to the track page.
But if you open the track in a new tab then you will see the track.
What did I do wrong?
My .htacess file looks like this:
RewriteEngine on
RewriteCond %{request_filename} -f
RewriteRule ^(.*) $1 [L]
RewriteRule index/a/(.*)/id/(.*)/ index.php?a=$1&id=$2 [L]
and the links I changed it to:
<a href="'.$url.'/index/a/track/id/'.$row['track'].'/"
but before I changed the link it looked like this:
<a href="'.$url.'/index.php?a=track&id='.$row['track'].'"
Your first rule is bogus. It always matches, then rewrites to exactly the same thing. This prevents the Apache from reaching the second rule.
Remove your first rule, and everything should work as expected.
I've searched thoroughly for a similar topic and couldn't find one. Here's hoping someone can help.
=> THE SET-UP:
I'm using an .htaccess mobile redirect that I found in the wild.
The redirect sends visitors on mobile devices from www.MYSITE.com to m.MYSITE.com (a simple .html "splash page"). On this mobile version is a link for visitors to use to continue to the full site:
Visit Full Version
=> THE PROBLEM:
A user visits www.MYSITE.com/page from a search engine. The user is redirected to the mobile splash page at m.MYSITE.com and they click the "Visit Full Version" link. Instead of being redirected to the full site version of www.MYSITE.com/page, they are sent to www.MYSITE.com.
I need visitors to be able to get back to the originally requested URL (like www.MYSITE.com/page or even www.MYSITE.com/page/post) from the m.MYSITE.com splash page "View Full Version" link.
My .htaccess code is below:
# If you're not already on m.YOUR_DOMAIN_NAME.com,
# and if you're on a mobile device,
# and if you just got here (didn't get here by clicking links on YOUR_DOMAIN_NAME.com),
# and if you're not just looking for pictures
# then go to the mobile site instead
RewriteCond %{HTTP_HOST} !^m\.MYSITE\.com [NC]
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|iphone|ipod|iemobile|webos|googlebot-mobile" [NC]
RewriteCond %{REQUEST_URI} !\.(jpg|png|gif)$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(.*).MYSITE.com/.*$ [NC]
RewriteRule ^(.*)$ http://m.MYSITE.com [L,R=302]
=> THE QUESTION:
What can I work into my .htaccess file and/or mobile index.php to send visitors back to their originally requested URL as the "Visit Full Version" link?
Any help is greatly appreciated!
Thanks,
Brian
Use conditional .htaccess here.
Pass parameter to decide whether you want to see the full site
Visit Full Version
if .htaccess check whether seeFullSite param is set and value is YES. if true, then do not redirect to your mobile site.
Example of conditional .htaccess ::
conditional htaccess?
Conditional .htaccess
I have been using .htaccess rules to hide the index page of EE sites for years now and this generally allows me to create a template within the site template group that will display without having to include the name of the site template group in the URL. Like this:
http://mysite.com/template_name
However, I am working on a site where I tried this and I keep getting a 404 error.
Here is the .htaccess code I am using:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
Here is the actual path: http://corecubed.com/main/landing-page
This is what it should be displaying as: http://corecubed.com/landing-page
(Note: this page is for mobile devices and displays quite large on a regular web page.)
Question is, why won't it display properly without including the name of the site template group and how do I fix it?
Thanks.
It sounds like Strict URLs are enabled under your Global Template Preferences. Try toggling that setting off.
This question already has answers here:
htaccess redirect all pages to single page
(6 answers)
Closed 9 years ago.
I have a site and I want to redirect everything to /index.html.
I'm replacing an old site so some visitors may try to access dead urls. How can I do this through .htaccess?
Also, is there a way to rewrite the url in the process so they just see http://www.example.com and not whatever they originally tried to access?
Thanks,
Howie
This should do the job:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* index.html
the index.html shall stay in the same directory of the htacess
Open IIS.
Select your website in left pane.
In IIS 7 choose option Default documents in middle box and add your required index page. In IIS 3 right click on website in left pane and choose properties>home directory> then add your index page name and bring it to top (Top for priority).
In the same page you have option to redirect your URL to another URL