I am running a WordPress site that was converted over from a static html site. I have an htaccess file in place to 1) rewrite posts (per WordPress), 2) redirect old pages to new pages.
My problem is that everything works fine except for simply redirecting www.example.com/index.html to www.example.com/
Here is what my htaccess file looks like:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
#
RewriteRule ^index.html$ http://www.example.com/ [R,L] – This is the one that does not work
RewriteRule ^aboutus.html$ http://www.example.com/about-my-company/ [R,L]
RewriteRule ^testimonials.html$ http://www.example.com/ [R,L]
RewriteRule ^portfolio.html$ http://www.example.com/company-portfolio/ [R,L]
RewriteRule ^services.html$ http://www.example.com/what-we-offer/ [R,L]
RewriteRule ^contact.html$ http://www.example.com/contact-us/ [R,L]
The entire thing can be rewritten. Here are my goals:
1) WordPress functionality for SEO links (which works now)
2) Pages that are old (like contact.html) are still in the search engine results. I want those redirected (or rewritten?) to the new url path. Those html files should not have to actually exist on the server.
3) definitely need http://www.example.com/index.html to redirect to http://www.example.com
I’m using the Vivvo CMS (http://vivvo.net) and I’m currently having some issues with the .htaccess file.
I had my webhost symlink my webalizer stats to show a “stats” folder on my websites. The problem is when trying to exclude this “stats” folder from the rewrite there is a conflict with one line.
If I remove that one line the “stats” folder shows on the web and I don’t get a 404 error. However, if that line is removed then there is a different section with a 404 error on my site (the authors listing page).
So I need someone to adjust the htaccess file so the “stats” folder shows and there are no 404 errors on the site due to changes in the file.
This should be a 5 minute job if you know about htaccess files and rewrites.
See the file below with my note next to the line that when removed causes another 404 error.
Options All -Indexes
ErrorDocument 404 /404.php
FileETag MTime Size
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !/stats
RewriteRule ^sitemap.xml$ index.php [L]
RewriteRule ^(.*)(.html|.htm)$ index.php [L]
RewriteRule ^(.*)(.rss|.atom|.txt)$ index.php [L]
RewriteRule ^([^.]*)/?$ index.php [L] <—- If Removed the “stats” folder shows. However, there will be another 404 error on my site
</IfModule>
**********************************************************************
!+++ this is an adult website +++! – you must be 18 and agree to work on an adult content website.
- no gay content, basically you be looking at adult dvd box covers.
**********************************************************************
Right now our URL’s look like the following:
** http://mysite.com/index.php?controller=Movie&action=index&movie=72003437
** http://mysite.com/index.php?controller=Browse&action=Category&category=13
** http://mysite.com/index.php?controller=Browse&action=studio&studio=200416
and I would like the rewrite to look like the following:
-** http://mysite.com/video/video/147899/TITLE-OF-MOVIE/?
-** http://mysite.com/studio/2578/CATEGORY-NAME/?
-** http://mysite.com/studio/2578/STUDIO-NAME/?
e.g: http://mysite.com/video/147899/College-Invasion-Vol-10
or http://mysite.com/1463340/College-Invasion-Vol-10-porn-movies.html
rewrite is going to look something like this…
RewriteEngine On
RewriteRule ^/([a-z]+)/([a-z]+)/([0-9]+) /index.php?controller=$1&action=$2&id=$3 [NC,L]
RewriteRule ^/([a-z]+)/([a-z]+)(:?|/)$ /index.php?controller=$1&action=$2 [NC,L]
RewriteRule ^/([a-z]+)(:?|/)$ /index.php?controller=$1 [NC,L]
*** I will also need a site map index if feasible.
Platform: FreeBSD-7.0 (dedicated box) + PHP5+mysql+apache 2.2(mod_rewrite enabled)
Categories: MySQL, PHP, Search Engine Optimization, System Administration Tags: action, Adult, amp, amp action, amp amp, category, com, com index, com studio 2578, controller, engine optimization system, following http mysite, http mysite, index, index php, like the, Movie, mysite, mysite com, MySQL, mysql search engine, optimization system administration, PHP, php controller, php controller browse, php mysql search, rewrite, rewrite site, rewrite site index, rewriterule, search engine optimization, site, site index, studio, the following http, URL, url rewrite, url rewrite site, Video
I am having problems writing an .htaccess file using RewriteRules to turn:
http://calgarypainters.net/showcategory.php?cid=201
into:
http://calgarypainters.net/categories/RESIDENTIAL/
and:
http://calgarypainters.net/view.php?id=40
info:
http://calgarypainters.net/listings/PAINT_CALGARY
Payment via Scriptlance or Paypal.
Website is located at:
http://www.calgarypainters.net
Thanks!
Categories: Links, Programming, Search Engine Optimization Tags: calgarypainters, calgarypainters net, htaccess, htaccess rewriterule, htaccess rewriterule programming, http calgarypainters, links search engine, net, programming links search, rewriterule, rewriterule programming links, search engine optimization, Search Engine Optimization, seo urls, seo urls htaccess, urls, urls htaccess, urls htaccess rewriterule
All I need is a redirection from
http:// domain.com/sth/user to http://user.domain.com
Here is my .htaccess code:
RewriteEngine On
RewriteRule ^index.html$ index.php
RewriteRule ^browse-(.*)-videos.html$ category.php?cat=$1
RewriteRule ^browse-(.*)-videos-([0-9]+)-(.*).html$ category.php?cat=$1&amp;page=$2&amp;sortby=$3
RewriteRule ^register.html$ register.php
RewriteRule ^contact_us.html$ contact_us.php
RewriteRule ^edit_profile.html$ edit_profile.php
RewriteRule ^suggest.html$ suggest.php
RewriteRule ^upload_avatar.html$ upload_avatar.php
RewriteRule ^suggest.html$ suggest.php
RewriteRule ^favorites.html(.*)$ favorites.php$1
RewriteRule ^login.html(.*)$ login.php$1
RewriteRule ^newvideos.html(.*)$ newvideos.php$1
RewriteRule ^topvideos.html(.*)$ topvideos.php$1
RewriteRule ^profile.html(.*)$ profile.php$1
RewriteRule ^favorites.html(.*)$ favorites.php$1
RewriteRule ^playlist/(.*)$ myfavorites.php?u=$1
RewriteRule ^memberlist.html(.*)$ memberlist.php$1
RewriteRule ^tags/([^/]+)/$ tag.php?t=$1&amp;page=1
RewriteRule ^tags/([^/]+)/page-([0-9]+)(/)?$ tag.php?t=$1&amp;page=$2
RewriteRule ^(.*)/(.*)-video_(.*).html$ musicvideo.php?vid=$3
RewriteRule ^rss.xml$ rss.php [L]
I want to have wild-subdomains (yes I have root access!)
Generally, when you click on (My Favorites) you are redirected to
http://www.domain.com/favorites.php?a=show
but if you are on your fav site you see at the bottom of the site additional note with a link:
“Share your favorites: http://www.domain.com/playlist/user
Categories: PHP, Programming, Search Engine Optimization Tags: amp, amp amp, amp page, com, Domain, domain com, Easy, easy job, favorites, favorites php, have root access, help with, help with htaccess, htaccess, htaccess easy, HTML, http user domain, http www, job, page, PHP, php rewriterule, php rewriterule ^suggest, php search engine, Profile, rewriterule, rewriterule ^browse videos, rewriterule ^favorites html, rewriterule ^suggest html, search engine optimization, site, user, with htaccess, with htaccess easy, www domain, ^favorites html favorites, ^suggest html suggest