Multiple .htaccess files - php

I'm relatively new to htaccess files and I'm trying to get my URL to look SEO friendly.
It says to change my htaccess.txt to .htaccess to allow URL overwrite but I have multiple htaccess files and don't know which to switch and what to do.
My goal is to get from:
http://www.sunshineorlandorentals.com/component/bookman/?PropertyId=1609
to:
http://www.sunshineorlandorentals.com/location/1609

Don't be confused about the multiple .htaccess files. The only file which is working is without any extension that means .htaccess is the right file. You can delete other .htaccess.txt files. Download them before Delete as Backup.
To redirect your current url to new one -- Simply ADD below line of code into your .htaccess file.
Redirect 301 /pagename.php http://www.example.com/pagename.html
Here pagename.php is your old url without Domain name
and pagename.html is new url with same Domain name, Replace example.com with yours one.
And your new Url http://www.sunshineorlandorentals.com/location/1609 is completely Seo friendly. Try to make all your urls like same in future.
Thanks

Just ignore all other files.
You just need to enable sef urls and sef rewrites on Joomla sites (in joomla config setting).
Create new hidden menu with alias 'location' pointing to your component that's it.

Related

Wordpress URL rewrites on NGINX server (without htaccess)

I've recently learned that I'm unable to use the .htaccess file to redirect and rewrite url's on an NGINX server. I'm in the process of migrating a 20,000 page .html website to wordpress, and must preserve the permalink structure and add redirects to maintain the SEO.
All I am trying to accomplish are two things:
Add a 301 redirect to .html pages that will point them to their .php counterparts
Remove the '/public_html/' folder from the page URL
www.website.com/public_html/[affiliate] => www.website.com/[affiliate]
I have been able to implement the 301 redirects via plugin for now, however I'm unsure how to go about removing the folder from the URL. I could place the affiliate folders in the root directory and not have to do this, but it will clutter up my workspace immensely.
This is my current attempt at rewriting the url (in site.conf.hbs --- is this the correct file?)
#
# Rewrite public_html out of url when visiting affiliate pages
#
location /public_html
{
rewrite ^(/public_html/.*)/(\w+).php /$2.php last;
}
Any help is much appreciated! The php redirect is working via plugin for now, but I'd like to just add it as a rule to get rid of the plugin if possible.
Thanks!

Url redirection for custom post types - wordpress

So i have created a plugin that gets data from a API and creates posts. For example posts urls are similar to following structure .
https://sitesite.net/invite/username
About 100 posts are created this way and the only thing differs is the username. I want to redirect all
urls with /invite to a certain another url.
What is the best way to do this? Please consider that i'm new to wordpress.
So far i've tried some plugins like Redirection plugin and SEO Redirection Premium plugins. But i could not find a way to redirect all the urls with /invite in the url to another url. Both these plugins can set the source url and redirect to another url. But it's not practical for me as i have 100s of urls.
How can i redirect all my urls to another url .
The best way is to do it directly in your .htaccess file in the root folder of your Wordpress installation.
The following rewrite rule will redirect all pages in your invite folder to the same page in another folder called newfolder:
RewriteRule ^invite/(.*)$ /newfolder/$1 [R=302,NC,L]
Note the R=302 - make sure you use this for testing and only change it to a permanent 301 redirect when you are sure everything works!
(The .htaccess is not a Wordpress file, standard file on your web hosting. But if you’re not familiar with it, it’s a very important file to make your site work, so check back with us if you’re unsure of anything before you change it and always make a backup before ANY changes to it!!)

create rewrite rules only for one specific folder

I am using WP site. its working fine. but i have one issue that is i have created a folder that is myfolder. In this folder i have created index.php file and added some JS and CSS files. so now my site link like below.
http://www.domain.com/myfolder/index.php?ver=52
Now i am working for increase site speed task. I want to enable gzip for this folder. so i think htaccess is the fine for increase speed of site. So i want to create rules only for this folder. when i will add condition rules only work for this folder then i can enable gzip for this folder. I am new in htaccess. So please let me know how i add condition and rewrite rules from htaccess from site htaccess file only for this folder.

How can I use a clean URL only in a subfolder of my website?

I have a web site http://www.mydomain.com
Here I have created a sub folder http://www.mydomain.com/products. I want to change all the page inside the product folder as clean URL. I know .htaccess should be inside product folder. If it's enabled, will it affect all the parent directories and files of my site
I mean http://www.mydomain.com/ here, will it affect the pages here also.
I have one more doubt about .htaccess file, is there a way I can enable mod_rewrite through any code code without directly editing httpd.conf file
Please help me
Thanks
i have one more doubt about .htaccess file, is there a way i can enable mod_rewrite through any code code without directly editing httpd.conf file
You place this line before any rewrite rules in your .htaccess file, which will switch on the rewrite engine - no httpd.conf change required.
RewriteEngine on
If it's enabled, will it affect all the parent directories and files of my site
The .htaccess file will only affect the folder it is in and any subfolder of that folder.

Can I use Code Igniter with Concrete5?

I am building a site that will (obvisouly) have a front end public portion that I want to drive with Concrete5, but then it will also have a members section that I would like to build with Code Igniter.
Does anyone have any idea how I could do that?
I guess I could just throw the Code Igniter code into a sub directory, but would I run into any issues with that?
i can't see why not.
As you suggested a separate folder on the site would be one solution.
(you might have to tweak the .htaccess file (if you are using one) to ignore the other cms/framework
Another solution would be to have separate subdomains,
eg example.com and members.example.com
The answer, since the OP hasn't posted it, is to change the .htaccess rule:
RewriteBase /
to:
RewriteBase /foo/
where foo is your subdirectory that the index.php and CI reside. This .htaccess should also be in the same folder as the CI index.php. Works like a charm. Also don't forget to add the subdirectory to the base_url config setting.
I ended up using a sub directory for Code Igniter. I had to change the .htaccess file and Mod_Rewrite rules for apache in order for the Code Igniter "pretty" URLs to work correctly.
I will post the code later if I remember.

Categories