pre_config_step_2.php?type=Grocery&count=2
to
/pre_config_step_2/Grocery/2
do i need to change the htaccess in the root directory and if so what do i change it to
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^pre_config_step_2/(\w+)/(\d+)$ pre_config_step_2.php?type=$1&count=$2
</IfModule>
That would consider accessing /pre_config_step_2/Grocery/2 as if requesting pre_config_step_2.php?type=Grocery&count=2.
Related
I have a web route problem in which one is badly located and I want to change it or redirect the one I want with the .htaccess file of my web page. Try creating a RewriteRule but it did not work. Could you help me?
Erroneous route: mysite.com/swf/c_images/navigator-thumbnail/foto.jpg Route that I want you to address or change: mysite.com/photos/thumbnail/foto
Here is my RewriteRule
RewriteRule ^swf/c_images/navigator-thumbnail/?$ $1/photos/thumbnail$2 [R=301,L]
Check this rule in top of your .htaccess file
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^swf\/c_images\/navigator-thumbnail\/(.*)\.jpg$ /photos/thumbnail/$1 [R=301,L]
</IfModule>
Rule rewrite your link
mysite.com/swf/c_images/navigator-thumbnail/foto.jpg <> mysite.com/photos/thumbnail/foto
and all jpg foto in /swf/c_images/navigator-thumbnail/ to /photos/thumbnail/
mysite.com/swf/c_images/navigator-thumbnail/any-foto.jpg <> mysite.com/photos/thumbnail/any-foto
I want to manipulate the URLs in my site. For example, I want to rewrite this URL profile/anything/about to profile/anything but it not just working, it shows my Page Not Found constructed page, here is my .htaccess file
ErrorDocument 404 /pageNotFound.php
<IfModule mod_rewrite.so>
Option +FollowSymLinks -MultiViews
RewriteEngine on
RewriteBase /
RewriteRule ^profile/(.*)/about profile/$1/index.php [NC,L]
</IfModule>
Please help me out, am new to this
I don't really see anything bad in your code but it didn't work for me also, but here is the trick. If "L" is included among your flags just make sure that the next line is commented. It worked for me.
And I think you should use the match any of contents = [] instead of any character
ErrorDocument 404 /pageNotFound.php
<IfModule mod_rewrite.so>
Option +FollowSymLinks -MultiViews
RewriteEngine on
RewriteBase /
RewriteRule ^profile/([0-9a-zA-Z]+)/about profile/$1/index.php [NC,L]
#this is a commented line after the LAST RULE flag
</IfModule>
I'm trying to install friendica on my webhost (hourb, similar to 000webhost but with ssh).
I'm installing it to a directory/subdomain imoppen.domain.com (domain.com/imoppen)
But it says: Url rewrite in .htaccess is not working. Check your server configuration.
and i can't continue the installation.
I think it's something that has to do with directory's with the rewritebase part, but i don't know how to fix it.
It also gives a error in php, but that is not a very big deal for me;
Warning: set_time_limit() has been disabled for security reasons in /home/username/public_html/imoppen/boot.php on line 290
My first .htaccess (domain.com) contains:
# DO NOT REMOVE THIS LINE AND THE LINES BELOW ERRORPAGEID:yLaNyW
ErrorDocument 404 /404.html
# DO NOT REMOVE THIS LINE AND THE LINES ABOVE yLaNyW:ERRORPAGEID
RewriteBase /
My second .htaccess (domain.com/installationdirectory) contains:
Options -Indexes
AddType application/x-java-archive .jar
AddType audio/ogg .oga
<FilesMatch "\.(out|log)$">
Deny from all
</FilesMatch>
SetEnv PHP_VER 5_3
<IfModule mod_rewrite.c>
RewriteEngine on
# Protect repository directory from browsing
RewriteRule "(^|/)\.git" - [F]
# Rewrite current-style URLs of the form 'index.php?q=x'.
# Also place auth information into REMOTE_USER for sites running
# in CGI mode.
# If you have troubles or use VirtualDocumentRoot
# uncomment this and set it to the path where your friendica installation is
# i.e.:
# Friendica url: http://some.example.com
# RewriteBase /
# Friendica url: http://some.example.com/friendica
# RewriteBase /imoppen/
#
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
</IfModule>
As you can see I've tried to use the rewritebase part, which unfortunately did not work.
My overall php version is set to 5.3
It seems like you are on hourb hosting (so am I) I solved it by going to settings -> htaccess -> Allow URL rewriting
Ok I have a script in the folder 'intake'. The index.php file auto creates a list of urls. Those urls are in the format:
/intake/4/Westrop
I have an .htaccess file in the intake folder. I want it to redirect the url to a FILE.
The above example would then become /intake/redirect.php?id=4&name=Westrop
Here's what I have so far:
DirectoryIndex index.php
Options All -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)/(.*)$ /intake/redirect.php?id=$1&name=$2 [L]
</IfModule>
But for some reason if I type /intake or /intake/index.php I get a 404 error. According to firebug its trying to take "intake" and turn it into "intake.php"
Any ideas?
Place the following code in .htaccess file in website root folder:
RewriteEngine On
RewriteRule ^intake/(\d+)/([a-z0-9\-_]+)$ /intake/redirect.php?id=$1&name=$2 [NC,QSA,L]
P.S.
Do not use this sort of pattern -- ^(.*)/(.*)$ -- in your case for longer URLs it will work not as you would expect. It will match your URL .. but in a wrong way.
Start your .htaccess with this option:
Options +All -MultiViews -Indexes
I have a url structure that looks like this:
http://www.blahblah.com/community/i/pagename
However, I want to remove the ugly /i/ part. Is this possible with Modrewrite?
Yes, it's possible:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^(\w+)/(\w+)$ $1/i/$2 [QSA]
</IfModule>