Here is my siteURL http://www.ebiztrait.com/CupidsElite/
I want to create internal pages for this site, with clean URL but as a content I want the same content as it is right now in home page.
So I just want to duplicate home page in siteURL/Success-Stories
Page should have clean URL like this siteURL/Success-Stories
my main condition is I dont want to add anything in .htaccess.
I appreciate if anybody can help me on this.
Thanks
Logically It is not possible without touching .htaccess or server side configuration.
When you write the URL your server is definitely going to look for the index.php file in the folder name.
login in joomla admin
goto global configration
SEF URL set to Yes
then finally save. and check.
Now, you can convert htaccess.txt file to .htaccess
then again check you site to refresh.
For your request is inevitable that you might edit .HTAccess
just add the following entry
<IfModule mod_rewrite.c>
RewriteEngine On
# Removes index.php from ExpressionEngine URLs
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>
Related
I'm trying to redirect old site files toward new CodeIgniter site with .htaccess.
So, my old file
www.mysite.com/news/new?id=123
have to redirect to
www.mysite.com/news/new/123
For now, my .htaccess has inside usually code to remove index.php and it works fine.
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^(.*)$ index.php?/$1
But when I try the old file redirect nothing works.
I think the issue's about CodeIgniter, becouse if I make a simple redirect to an external file, like phpinfo.php it works fine, but if a try the redirect to index.php (of CodeIgniter) it doesn't load index.php but try to load other. Also does if I delete .htaccess code for index.php (see upside).
So,
RewriteRule news/new.php phpinfo.php [L] # it works
but
RewriteRule news/new.php index.php [L] # it doesn't work
Codeigniter use REQUEST_URI Apache variable that can not change with RewriteRule and without redirection. So you can use _remap function in news controller to call your custom method.
Other way that can be doing with htaccess is enabling query string.
Try
RewriteRule news/new\?id=(.*)$ index.php/news/new/$1 [L]
I'm working on an open cart site and I was editing the .htaccess file to allow for SEO friendly URLs.
The system is in a subdirectory if that helps.
Some of the work was done prior to me taking on the job by another developer who isnt providing any help at the moment. (I've took out the actual url as I can only currently post a limited amount of links per post)
RedirectMatch permanent ^/$ http://www.furnishingsdirect.co.uk/new
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.furnishingsdirect\.co\.uk [NC]
RewriteRule (.*) http://www.furnishingsdirect.co.uk/$1 [R=301,L]
RewriteEngine on
Options +FollowSymLinks#RewriteCond %{THE_REQUEST} ^.*/index\.php [NC]
RewriteRule ^(.*)index.php$ http://www.furnishingsdirect.co.uk/$1 [R=301,L]
The second .htaccess file contains:
Options +FollowSymlinks
Options -Indexes
<FilesMatch "\.(tpl|ini|log)">
Order deny,allow
Deny from all
</FilesMatch>
RewriteBase /new/
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^download/(.*) /index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
Whenever I try to access the website through the url
http://www.furnishingsdirect.co.uk
or
http://www.furnishingsdirect.co.uk/new/
It states that "Firefox has detected that the server is redirecting the request for this address in a way that will never complete."
I'm positive that this code was fine earlier till I altered the web forwarding through 123 reg. I forwarded the furnishing direct domain so that it always directed users to the directory with the shop system in it. I think that is what has cause the issue, 123 reg says it will take some time for the site to adjust but Im unsure. Can anyone help shed some light on this situation? any help would be appreciated.
The DNS for this domain is pointing to web hosting, it was originally pointing to the 123 reg holding/forwarding service.
your problem probably is in the config.php file, if this constant was defined to your root, and your .htaccess redirect to your /new, you get into a loop. look at this on your config.php file:
// HTTP
define('HTTP_SERVER', 'http://www.furnishingsdirect.co.uk/');
and change to '/new'.
First of all if you have 2 .htaccess files, please use the second one as it is closer to the default one the first has many changes to it. Or better yet if you find extensive trouble download a new .htaccess from the Opencart site (for the appropriate version ofc.)
Secondly check your config.php that
define('HTTP_SERVER', 'http://domain/');
and
define('HTTPS_SERVER', 'http://domain/');
are set correctly.
Except from defining the base there should be no other need for your cart to be functional, if you want to add custom .htaccess code please add at the end of the .htaccess files (that is the way i use some domain redirects for example)
I'm aware that there are a few questions on this subject already. I've trawled through them and can't make any of the proposed solutions work for me... maybe someone can help my specific problem?
I have a folder, parallax, in my app/webroot, containing index.html and associated files. This can be accessed just fine at /parallax/. However, if I try to access it at /parallax I get redirected to /app/webroot/parallax/, and ideally I'd like to suppress this behaviour.
Refactoring the whole thing as a CakePHP controller action isn't ideally something I want to get into (though if it might be simpler than I expect, let me know). The routes file doesn't as far as I know allow routing to a file in app/webroot.
The other port of call would seem to be the .htaccess file. I tried adding a rewrite rule:
RewritRule ^parallax$ parallax/index.html
or variations thereof, but the best I can get here is a page with broken images (whatever I'm ending up with, it doesn't seem to be able to find the images in the parallax/images subfolder any more).
Can anyone clear up my confusion and help me find the best route to /parallax giving the same result as /parallax/ does?
Please try the below .htaccess code in your root directory not in app directory.
<IfModule mod_rewrite.c>
RewriteEngine on
Rewriterule ^parallax/.*$ - [PT]
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
This should help you. What ever request start with parallax will be skipped by the .htaccess rule. And rest of the things will work as it is.
.htaccess root thanks to Anh Pham for this link it works perfectly http://www.balistupa.com/blog/2010/08/how-to-redirect-appwebrootblog-into-blog-wordpress-cakephp/
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_URI} !^/foldername.*
RewriteCond %{REQUEST_URI} !-f
RewriteRule ^$ app/webroot/ [L]
RewriteCond %{REQUEST_URI} !^/foldername.*
RewriteCond %{REQUEST_URI} !-d
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
I tried to reproduce the situation but its working corretly for me. I'm using cakePhp 1.3 and both urls send me to index.html:
http://localhost:5013/parallax/
http://localhost:5013/parallax
My guess is that there's something weird on your .htaccess (the one located at /app/webroot/). Mine is:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>
Basically, it tells the server that if the requested url is not a file (!-f) nor a directory (!-d), it will redirect the whole url as a parameter to /webroot/index.php , so cakephp will parse the url and call the controllers and all that..
Hope this helps
You should be able to put the parallax folder with a static index.html inside the app/webroot folder and have it be accessible by default at the /parallax/ url.
If you use relative paths you can even have you img/css for that page local to the folder and skip the usual cakephp paths entirely. No htaccess needed.
My question may look similar to others, but it's different as you'll se:
I have 5 CI apps running with the same System Folder, as described in CI User Guide.
Now, I want some .htacces file to remove just the .php from the url, like, as example: http://example.com/appName/controller/action instead of http://example.com/appName.php/controller/action (removing the .php portion of the url)
Can I do that? I have no experience with .htaccess files. Also, I'm developing the site in Windows 7 with XAMPP, to deploy the site to a LAMP server.
Thanks in advance
Try This
RewriteEngine on
RewriteBase /
# Hide the application and system directories by redirecting the request to index.php
RewriteRule ^(application|system|\.svn) appName/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ appName.php/$1 [QSA,L]
check code igniter manual. It has a chapter for that purpose http://codeigniter.com/user_guide/general/urls.html
Removing the index.php file
By default, the index.php file will be included in your URLs:
example.com/index.php/news/article/my_article
You can easily remove this file by using a .htaccess file with some simple rules. Here is an example of such a file, using the "negative" method in which everything is redirected except the specified items:
RewriteEngine on
RewriteCond $1 !^(index.php|images|robots.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
In the above example, any HTTP request other than those for index.php, images, and robots.txt is treated as a request for your index.php file.
I'm taking over a website for a client that is running on a custom built CMS (that I didn't write). I don't mess with .htaccess files usually because a lot of the hosting I do is on IIS, or I used WordPress as a CMS and don't have to worry about messing with the .htaccess file. Here's the contents of the file:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ framework.php?%{QUERY_STRING}&resource=$1& [L]
I get what it's doing (sending all requests through the framework.php file). The client wants a WordPress blog added to their site. I'm placing it in a /blog/ folder. The problem is that because of the rewrite rules and conditions in the .htaccess file whenever I try to go /blog/ the other CMS freaks out because it doesn't like me trying to go there. My question is how do I write a rule/cond that tells apache to send all requests made to the /blog/ folder to the /blog/ folder, but keep all other requests piped through the framework.php file like it is now? Any help is appreciated, thanks!
You should be able to tell the main .htaccess file to ignore any /blog links by adding a RewriteCond to the main rule:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/blog(/?)
RewriteRule ^(.*)$ framework.php?%{QUERY_STRING}&resource=$1& [L]
A /blog link won't be sent to framework.php, and should serve from the /blog directory normally. The Wordpress .htaccess file in that directory will be invoked as it normally would, and should be able to handle Wordpress links from there.